Skip to content
Commits on Source (3)
#ifndef BORK_H
#define BORK_H
#include "gagtable.h"
char *apply_bork(char *text, const struct pattern *list, int caps);
#endif /* BORK_H */
......@@ -18,39 +18,6 @@
extern struct user * const user;
void send_mesg(char *from, const char *to, char *text, int wiz)
{
char buff[MAXTEXTLENGTH];
_autofree struct user *usr = calloc(1, sizeof(*usr));
if (usr == NULL) {
perror("calloc");
return;
}
if (!user_exists(to, usr)) {
printf(_("User does not exist.\n"));
return;
}
if (! u_reg(usr)) {
printf(_("%s is not registered.\n"),to);
return;
}
if (u_mesg(usr)) {
if (wiz) {
printf(_("%s has msg off, writing anyway.\n"),to);
} else {
printf(_("%s has turned messages off.\n"),to);
return;
}
}
snprintf(buff, MAXTEXTLENGTH, "*** %s: %s", from, text);
if (ipc_send_to_username(to, IPC_WIZ, buff) <= 0) {
printf(_("User not logged on.\n"));
return;
}
mwlog("TELL %s %s", to, text);
}
void inform_of_mail(char *to)
{
if (ipc_send_to_username(to, IPC_NEWMAIL, NULL) < 0)
......
......@@ -6,7 +6,6 @@
void broadcast(int state, const char *fmt, ...) __attribute__((format(printf,2,3)));
void inform_of_mail(char *to);
void postinfo(struct user *who, struct folder *fol, struct Header *mesg);
void send_mesg(char *from, const char *to, char *text, int wiz);
void mwlog(const char *fmt, ...) __attribute__((format(printf,1,2)));
#endif /* MESG_H */
......@@ -56,10 +56,10 @@ static int old_usr(struct user *usr)
{
strncpy(salt, usr->record.passwd, 2);
fflush(stdin);
strcpy(passwd,crypt(get_pass(_("Enter Password: ")),salt));
strcpy(passwd,crypt(get_pass(_("Enter password: ")),salt));
if (strcmp(passwd, usr->record.passwd))
{
printf(_("Login Incorrect.\n\n"));
printf(_("Login incorrect.\n\n"));
exit(0);
}
}
......@@ -270,7 +270,7 @@ static int new_usr(char *name, struct user *u)
printf(_("\nIf you do not wish to register, do not enter a name.\n\n"));
printf(_("Real Name: "));
printf(_("Real name: "));
usr->realname[0]=0;
get_str(usr->realname,REALNAMESIZE);
if (!usr->realname[0])
......
......@@ -40,7 +40,7 @@ void gag_ack(char *text);
void gag_hazelesque(char *text);
void gag_pklong(char *text);
void gag_unreturnable(char *text);
char *apply_bork(char *text, const gag_pattern_t *list, int caps);
static char *apply_bork(char *text, const gag_pattern_t *list, int caps);
/****
* List ALL the gags
......@@ -765,7 +765,7 @@ void gag_pklong(char *text)
/**
* old style lookup table gag filters
**/
char *apply_bork(char *text, const gag_pattern_t *list, int caps)
static char *apply_bork(char *text, const gag_pattern_t *list, int caps)
{
static char buff[MAXTEXTLENGTH];
int tp=0, bp=0;
......