/*
* $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.
*
*/
#include <sys/wait.h>
#include <string.h>
#include <limits.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#include "policy.h"
#include "database.h"
#include "msgbase.h"
-#include "tools.h"
#include "ctdl_module.h"
*/
PerformSessionHooks(EVT_RWHO);
cprintf("000\n");
- }
+}
/*
extract_token(newroomname, argbuf, 0, '|', sizeof newroomname);
newroomname[ROOMNAMELEN-1] = 0;
- if (strlen(newroomname) > 0) {
+ if (!IsEmptyStr(newroomname)) {
safestrncpy(CC->fake_roomname, newroomname,
sizeof(CC->fake_roomname) );
}
char newhostname[64];
extract_token(newhostname, argbuf, 0, '|', sizeof newhostname);
- if (strlen(newhostname) > 0) {
+ if (!IsEmptyStr(newhostname)) {
safestrncpy(CC->fake_hostname, newhostname,
sizeof(CC->fake_hostname) );
}
if (CtdlAccessCheck(ac_aide)) return;
- if (strlen(newusername) > 0) {
+ if (!IsEmptyStr(newusername)) {
CC->cs_flags &= ~CS_STEALTH;
memset(CC->fake_username, 0, 32);
if (strncasecmp(newusername, CC->curr_user,
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,
}
-
-
-
-
-
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$";
}