From: Dave West Date: Sat, 5 Apr 2008 19:51:53 +0000 (+0000) Subject: Quieten the user 0 message to the Aide room. X-Git-Tag: v7.86~2353 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=f6a784d414ae095a6d9cd6a0e0de453adfb19692 Quieten the user 0 message to the Aide room. User 0 is created as a side effect of the system posting messages from the masterCC. This side effect has the benefit of recording the number of messages the system has generated. Should we make use of this somewhere? The actual code that creates the user 0 is in CtdlSubmitMsg() and reads as /* Bump this user's messages posted counter. */ CtdlLogPrintf(CTDL_DEBUG, "Updating user\n"); lgetuser(&CCC->user, CCC->curr_user); CCC->user.posted = CCC->user.posted + 1; lputuser(&CCC->user); Its around msgbase.c:2624 --- diff --git a/citadel/modules/expire/serv_expire.c b/citadel/modules/expire/serv_expire.c index b494d9755..33d9508e4 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/modules/expire/serv_expire.c @@ -443,7 +443,7 @@ void do_user_purge(struct ctdluser *us, void *data) { /* User number 0, as well as any negative user number, is * also impossible. */ - if (us->usernum < 1L) purge = 1; + if (us->usernum < 0L) purge = 1; /* If the user has no full name entry then we can't purge them * since the actual purge can't find them. @@ -452,18 +452,21 @@ void do_user_purge(struct ctdluser *us, void *data) { */ if (IsEmptyStr(us->fullname)) { - purge=0; - if (users_corrupt_msg == NULL) + if (us->usernum > 0L) { - users_corrupt_msg = malloc(SIZ); - strcpy(users_corrupt_msg, "The auto-purger found the following user numbers with no name.\n" - "Unfortunately the auto-purger is not yet able to fix this problem.\n" - "This problem is not considered serious since a user with no name can\n" - "not log in.\n"); - } + purge=0; + if (users_corrupt_msg == NULL) + { + users_corrupt_msg = malloc(SIZ); + strcpy(users_corrupt_msg, "The auto-purger found the following user numbers with no name.\n" + "Unfortunately the auto-purger is not yet able to fix this problem.\n" + "This problem is not considered serious since a user with no name can\n" + "not log in.\n"); + } - users_corrupt_msg=realloc(users_corrupt_msg, strlen(users_corrupt_msg)+SIZ); - snprintf(&users_corrupt_msg[strlen(users_corrupt_msg)], SIZ, " %ld\n", us->usernum); + users_corrupt_msg=realloc(users_corrupt_msg, strlen(users_corrupt_msg)+SIZ); + snprintf(&users_corrupt_msg[strlen(users_corrupt_msg)], SIZ, " %ld\n", us->usernum); + } }