From af926964ba30ef9a74342da2bdffe8ebec9a742b Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 7 Feb 2003 22:51:07 +0000 Subject: [PATCH] Fixes for whoson and send online message --- ChangeLog | 3 +++ TODO | 7 +++++++ mbsebbs/whoson.c | 24 ++++++++++++------------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d92a24fb..0ed30143 100644 --- a/ChangeLog +++ b/ChangeLog @@ -87,6 +87,9 @@ v0.37.01 14-Jan-2003. New menu 221, display arearules. This function tries to find the arearules in the rules directory and if found displays this to the user. + Fixed whoson list to display user real names and handles again. + Fixed send online message to send to user real names, handles + and unix names again. examples: The English and Dutch templates are updated to show the new diff --git a/TODO b/TODO index 4d92d559..7f68859a 100644 --- a/TODO +++ b/TODO @@ -39,6 +39,13 @@ mbsebbs: N: Only count posted messages in local mail areas. + L: ChangeHandle, allow own unix name as handle. + + +newuser: + L: Allow handles to be the same as the unixname. + + mbfido: N: The elist rules files are named (8.3) areaname.rul where areaname is the first 8 characters of the area name and we use the full name diff --git a/mbsebbs/whoson.c b/mbsebbs/whoson.c index ec7f27e1..d3d5fff0 100644 --- a/mbsebbs/whoson.c +++ b/mbsebbs/whoson.c @@ -104,10 +104,10 @@ void WhosOn(char *OpData) device = xstrcpy(strtok(NULL, ",")); fullname = xstrcpy(strtok(NULL, ",")); - if (((strcasecmp(OpData, "/H")) == 0) || (strcasecmp(OpData, "/U") == 0)) { + if (((strcasecmp(OpData, "/H")) == 0) || (strlen(OpData) == 0)) { /* - * The mbtask daemon has only the users real names, we - * want the handle or unix name instead. + * The mbtask daemon has only the users Unix names, we + * want the handle or real name instead. */ temp = calloc(PATH_MAX, sizeof(char)); sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT")); @@ -115,13 +115,13 @@ void WhosOn(char *OpData) fread(&ushdr, sizeof(ushdr), 1, fp); while (fread(&us, ushdr.recsize, 1, fp) == 1) { - if (strcmp(fullname, us.sUserName) == 0) { + if (strcmp(fullname, us.Name) == 0) { if ((strcasecmp(OpData, "/H") == 0) && strlen(us.sHandle)) { free(fullname); fullname = xstrcpy(us.sHandle); - } else if (strcasecmp(OpData, "/U") == 0) { + } else if (strlen(OpData) == 0) { free(fullname); - fullname = xstrcpy(us.Name); + fullname = xstrcpy(us.sUserName); } break; } @@ -289,10 +289,10 @@ void SendOnlineMsg(char *OpData) } /* - * If we were displaying handles or unix names, then lookup the - * users fullname to send to mbtask. + * If we were displaying handles or real names, then lookup the + * users unix name to send to mbtask. */ - if ((strcasecmp(OpData, "/H") == 0) || (strcasecmp(OpData, "/U") == 0)) { + if ((strcasecmp(OpData, "/H") == 0) || (strlen(OpData) == 0)) { temp = calloc(PATH_MAX, sizeof(char)); sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT")); if ((fp = fopen(temp, "rb")) != NULL) { @@ -301,10 +301,10 @@ void SendOnlineMsg(char *OpData) while (fread(&us, ushdr.recsize, 1, fp) == 1) { if ((strcasecmp(OpData, "/H") == 0) && strlen(us.sHandle) && (strcasecmp(User, us.sHandle) == 0)) { - sprintf(User, "%s", us.sUserName); + sprintf(User, "%s", us.Name); break; - } else if ((strcasecmp(OpData, "/U") == 0) && (strcasecmp(User, us.Name) == 0)) { - sprintf(User, "%s", us.sUserName); + } else if ((strlen(OpData) == 0) && (strcasecmp(User, us.sUserName) == 0)) { + sprintf(User, "%s", us.Name); break; } }