]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/rwho/serv_rwho.c
Added a RENU command (REName a User)
[citadel.git] / citadel / modules / rwho / serv_rwho.c
index d8a1285babaf72f612b672d2896d3fe81a161e36..272a0de9e7e28d598f60ad7b5fd271996400ddb4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * This module implementsserver commands related to the display and
+ * This module implements server commands related to the display and
  * manipulation of the "Who's online" list.
  *
  */
@@ -30,6 +30,7 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
@@ -41,7 +42,6 @@
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
-#include "tools.h"
 
 
 #include "ctdl_module.h"
@@ -154,7 +154,7 @@ void cmd_rwho(char *argbuf) {
         */
        PerformSessionHooks(EVT_RWHO);
        cprintf("000\n");
-       }
+}
 
 
 /*
@@ -238,9 +238,11 @@ void cmd_stel(char *cmdbuf)
 
        if (requested_mode == 1) {
                CC->cs_flags = CC->cs_flags | CS_STEALTH;
+               PerformSessionHooks(EVT_STEALTH);
        }
        if (requested_mode == 0) {
                CC->cs_flags = CC->cs_flags & ~CS_STEALTH;
+               PerformSessionHooks(EVT_UNSTEALTH);
        }
 
        cprintf("%d %d\n", CIT_OK,
@@ -248,19 +250,17 @@ void cmd_stel(char *cmdbuf)
 }
 
 
-
-
-
-
-
 CTDL_MODULE_INIT(rwho)
 {
-        CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online");
-        CtdlRegisterProtoHook(cmd_hchg, "HCHG", "Masquerade hostname");
-        CtdlRegisterProtoHook(cmd_rchg, "RCHG", "Masquerade roomname");
-        CtdlRegisterProtoHook(cmd_uchg, "UCHG", "Masquerade username");
-        CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode");
-
+       if(!threading)
+       {
+               CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online");
+               CtdlRegisterProtoHook(cmd_hchg, "HCHG", "Masquerade hostname");
+               CtdlRegisterProtoHook(cmd_rchg, "RCHG", "Masquerade roomname");
+               CtdlRegisterProtoHook(cmd_uchg, "UCHG", "Masquerade username");
+               CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode");
+       }
+       
        /* return our Subversion id for the Log */
         return "$Id$";
 }