Attempt to add first/last names to bluewave scan

This commit is contained in:
Andrew Pamment 2018-01-07 22:59:39 +10:00
parent efd022efd8
commit 76de1e7f4b
3 changed files with 14 additions and 4 deletions

View File

@ -242,3 +242,4 @@ File exists!\r\n
\r\nFirstname may not begin or end with a space\r\n \r\nFirstname may not begin or end with a space\r\n
\r\nLastname may not begin or end with a space\r\n \r\nLastname may not begin or end with a space\r\n
\r\nFirst & Last Name combination in use!\r\n \r\nFirst & Last Name combination in use!\r\n
\r\nSpaces not allowed\r\n

View File

@ -61,8 +61,10 @@ int bwave_scan_area(int confr, int area, int areano, int totmsgs, FILE *fti_file
struct fido_addr *fido; struct fido_addr *fido;
char *body; char *body;
struct tm timeStruct; struct tm timeStruct;
char realname[66];
char *month_name[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; char *month_name[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
snprintf(realname, 65, "%s %s", gUser->firstname, gUser->lastname);
if (msghs == NULL) { if (msghs == NULL) {
return totmsgs; return totmsgs;
} }
@ -111,7 +113,7 @@ int bwave_scan_area(int confr, int area, int areano, int totmsgs, FILE *fti_file
} }
if (msghs->msgs[k]->to != NULL) { if (msghs->msgs[k]->to != NULL) {
if (strcasecmp(msghs->msgs[k]->to, gUser->loginname) == 0) { if (strcasecmp(msghs->msgs[k]->to, gUser->loginname) == 0 || strncasecmp(msghs->msgs[k]->to, realname, 42) == 0) {
personal_msgs++; personal_msgs++;
} }
} }
@ -246,7 +248,8 @@ void bwave_create_packet() {
hdr.ver = PACKET_LEVEL; hdr.ver = PACKET_LEVEL;
strncpy(hdr.loginname, gUser->loginname, 42); strncpy(hdr.loginname, gUser->loginname, 42);
strncpy(hdr.aliasname, gUser->loginname, 42); //strncpy(hdr.aliasname, gUser->loginname, 42);
snprintf(hdr.aliasname, 42, "%s %s", gUser->firstname, gUser->lastname);
hdr.zone = converts(conf.main_aka->zone); hdr.zone = converts(conf.main_aka->zone);
hdr.node = converts(conf.main_aka->node); hdr.node = converts(conf.main_aka->node);
hdr.net = converts(conf.main_aka->net); hdr.net = converts(conf.main_aka->net);

View File

@ -655,7 +655,10 @@ struct user_record *new_user() {
s_printf(get_string(167)); s_printf(get_string(167));
continue; continue;
} }
if (strchr(buffer, ' ') != NULL) {
s_printf(get_string(244));
continue;
}
s_printf("\r\n"); s_printf("\r\n");
user->firstname = strdup(buffer); user->firstname = strdup(buffer);
nameok = 1; nameok = 1;
@ -674,7 +677,10 @@ struct user_record *new_user() {
s_printf(get_string(167)); s_printf(get_string(167));
continue; continue;
} }
if (strchr(buffer, ' ') != NULL) {
s_printf(get_string(244));
continue;
}
s_printf("\r\n"); s_printf("\r\n");
nameok = 1; nameok = 1;
user->lastname = strdup(buffer); user->lastname = strdup(buffer);