if (!strncasecmp(buf, "m=", 2)) {
msgnum = atol(&buf[2]);
if (msgnum > 0L) {
- CtdlDeleteMessages(roomname, &msgnum, 1, "", 0);
+ CtdlDeleteMessages(roomname, &msgnum, 1, "");
}
}
}
++num_rooms_purged;
}
- if (num_rooms_purged > 0) aide_message(transcript);
+ if (num_rooms_purged > 0) aide_message(transcript, "Room Autopurger Message");
free(transcript);
lprintf(CTDL_DEBUG, "Purged %d rooms.\n", num_rooms_purged);
/*
* Back end function to check user accounts for associated Unix accounts
- * which no longer exist.
+ * which no longer exist. (Only relevant for host auth mode.)
*/
void do_uid_user_purge(struct ctdluser *us, void *data) {
-#ifdef ENABLE_AUTOLOGIN
struct PurgeList *pptr;
if ((us->uid != (-1)) && (us->uid != CTDLUID)) {
UserPurgeList = pptr;
}
}
-
-#endif /* ENABLE_AUTOLOGIN */
}
char *transcript = NULL;
lprintf(CTDL_DEBUG, "PurgeUsers() called\n");
-#ifdef ENABLE_AUTOLOGIN
- ForEachUser(do_uid_user_purge, NULL);
-#else
- if (config.c_userpurge > 0) {
- ForEachUser(do_user_purge, NULL);
+
+ if (config.c_auth_mode == 1) {
+ /* host auth mode */
+ ForEachUser(do_uid_user_purge, NULL);
+ }
+ else {
+ /* native auth mode */
+ if (config.c_userpurge > 0) {
+ ForEachUser(do_user_purge, NULL);
+ }
}
-#endif
transcript = malloc(SIZ);
strcpy(transcript, "The following users have been auto-purged:\n");
++num_users_purged;
}
- if (num_users_purged > 0) aide_message(transcript);
+ if (num_users_purged > 0) aide_message(transcript,"User Purge Message");
free(transcript);
lprintf(CTDL_DEBUG, "Purged %d users.\n", num_users_purged);
retval = PurgeEuidIndexTable();
lprintf(CTDL_NOTICE, "Purged %d entries from the EUID index.\n", retval);
+ retval = TDAP_ProcessAdjRefCountQueue();
+ lprintf(CTDL_NOTICE, "Processed %d message reference count adjustments.\n", retval);
+
lprintf(CTDL_INFO, "Auto-purger: finished.\n");
last_purge = now; /* So we don't do it again soon */
if ( (smi.meta_refcount != realcount)
|| (realcount == 0) ) {
- smi.meta_refcount = realcount;
- PutMetaData(&smi);
- AdjRefCount(msgnum, 0); /* deletes if needed */
+ AdjRefCount(msgnum, (smi.meta_refcount - realcount));
}
}