]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
Changes to dynloader et al to handle ICQ module being written
[citadel.git] / citadel / citserver.c
index 693357e3da999aca497d7309044ef92fde13e9d7..45d23b95e9f5c879bd8b6ee8debcb1a97d6182f6 100644 (file)
@@ -40,6 +40,8 @@
 
 struct CitContext *ContextList = NULL;
 int ScheduledShutdown = 0;
+int do_defrag = 0;
+int (*CtdlSendExpressMessageFunc) (char *, char *, char *) = NULL;
 
 /*
  * Various things that need to be initialized at startup
@@ -48,6 +50,9 @@ void master_startup(void) {
        lprintf(7, "Opening databases\n");
        open_databases();
 
+       if (do_defrag)
+               defrag_databases();
+
        lprintf(7, "Checking floor reference counts\n");
        check_ref_counts();
 
@@ -864,10 +869,12 @@ void *context_loop(struct CitContext *con)
                lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
 
                /*
-                * Let other clients see the last command we executed, but
-                * exclude NOOP because that would be boring.
+                * Let other clients see the last command we executed, and
+                * update the idle time, but not NOOP, PEXP, or GEXP.
                 */
-               if (strncasecmp(cmdbuf, "NOOP", 4)) {
+               if ( (strncasecmp(cmdbuf, "NOOP", 4))
+                  && (strncasecmp(cmdbuf, "PEXP", 4))
+                  && (strncasecmp(cmdbuf, "GEXP", 4)) ) {
                        strcpy(CC->lastcmdname, "    ");
                        strncpy(CC->lastcmdname, cmdbuf, 4);
                        time(&CC->lastidle);
@@ -1251,6 +1258,9 @@ void *context_loop(struct CitContext *con)
                                    ERROR);
                        }
 
+               /* Run any after-each-command outines registered by modules */
+               PerformSessionHooks(EVT_CMD);
+
                } while(strncasecmp(cmdbuf, "QUIT", 4));
 
        cleanup(EXIT_NORMAL);