Here it is, the new thread interface.
[citadel.git] / citadel / modules / chat / serv_chat.c
index fff6640fe55f9156af8f546238e2c0202ec48adf..c77b36ab902f7cc700d7ded0eb3d5c8fc866c7ba 100644 (file)
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "serv_chat.h"
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "tools.h"
 #include "msgbase.h"
 #include "user_ops.h"
 #include "room_ops.h"
@@ -815,16 +815,19 @@ void cmd_reqt(char *argbuf) {
 
 CTDL_MODULE_INIT(chat)
 {
-       CtdlRegisterProtoHook(cmd_chat, "CHAT", "Begin real-time chat");
-       CtdlRegisterProtoHook(cmd_pexp, "PEXP", "Poll for instant messages");
-       CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get instant messages");
-       CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an instant message");
-       CtdlRegisterProtoHook(cmd_dexp, "DEXP", "Disable instant messages");
-       CtdlRegisterProtoHook(cmd_reqt, "REQT", "Request client termination");
-       CtdlRegisterSessionHook(cmd_gexp_async, EVT_ASYNC);
-       CtdlRegisterSessionHook(delete_instant_messages, EVT_STOP);
-       CtdlRegisterXmsgHook(send_instant_message, XMSG_PRI_LOCAL);
-
+       if (!threading)
+       {
+               CtdlRegisterProtoHook(cmd_chat, "CHAT", "Begin real-time chat");
+               CtdlRegisterProtoHook(cmd_pexp, "PEXP", "Poll for instant messages");
+               CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get instant messages");
+               CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an instant message");
+               CtdlRegisterProtoHook(cmd_dexp, "DEXP", "Disable instant messages");
+               CtdlRegisterProtoHook(cmd_reqt, "REQT", "Request client termination");
+               CtdlRegisterSessionHook(cmd_gexp_async, EVT_ASYNC);
+               CtdlRegisterSessionHook(delete_instant_messages, EVT_STOP);
+               CtdlRegisterXmsgHook(send_instant_message, XMSG_PRI_LOCAL);
+       }
+       
        /* return our Subversion id for the Log */
        return "$Id$";
 }