Don't register commands twice, only register them before threading begins.
[citadel.git] / citadel / msgbase.c
index 2de00fd2909475770ebbcdfb4b616487e03b04e7..9f4c5f222be5cae08cb154852d5cbe05564cf9e7 100644 (file)
@@ -4811,18 +4811,20 @@ void cmd_isme(char *argbuf) {
 
 CTDL_MODULE_INIT(msgbase)
 {
-       CtdlRegisterProtoHook(cmd_msgs, "MSGS", "Output a list of messages in the current room");
-       CtdlRegisterProtoHook(cmd_msg0, "MSG0", "Output a message in plain text format");
-       CtdlRegisterProtoHook(cmd_msg2, "MSG2", "Output a message in RFC822 format");
-       CtdlRegisterProtoHook(cmd_msg3, "MSG3", "Output a message in raw format (deprecated)");
-       CtdlRegisterProtoHook(cmd_msg4, "MSG4", "Output a message in the client's preferred format");
-       CtdlRegisterProtoHook(cmd_msgp, "MSGP", "Select preferred format for MSG4 output");
-       CtdlRegisterProtoHook(cmd_opna, "OPNA", "Open an attachment for download");
-       CtdlRegisterProtoHook(cmd_dlat, "DLAT", "Download an attachment");
-       CtdlRegisterProtoHook(cmd_ent0, "ENT0", "Enter a message");
-       CtdlRegisterProtoHook(cmd_dele, "DELE", "Delete a message");
-       CtdlRegisterProtoHook(cmd_move, "MOVE", "Move or copy a message to another room");
-       CtdlRegisterProtoHook(cmd_isme, "ISME", "Determine whether an email address belongs to a user");
+       if (!threading) {
+               CtdlRegisterProtoHook(cmd_msgs, "MSGS", "Output a list of messages in the current room");
+               CtdlRegisterProtoHook(cmd_msg0, "MSG0", "Output a message in plain text format");
+               CtdlRegisterProtoHook(cmd_msg2, "MSG2", "Output a message in RFC822 format");
+               CtdlRegisterProtoHook(cmd_msg3, "MSG3", "Output a message in raw format (deprecated)");
+               CtdlRegisterProtoHook(cmd_msg4, "MSG4", "Output a message in the client's preferred format");
+               CtdlRegisterProtoHook(cmd_msgp, "MSGP", "Select preferred format for MSG4 output");
+               CtdlRegisterProtoHook(cmd_opna, "OPNA", "Open an attachment for download");
+               CtdlRegisterProtoHook(cmd_dlat, "DLAT", "Download an attachment");
+               CtdlRegisterProtoHook(cmd_ent0, "ENT0", "Enter a message");
+               CtdlRegisterProtoHook(cmd_dele, "DELE", "Delete a message");
+               CtdlRegisterProtoHook(cmd_move, "MOVE", "Move or copy a message to another room");
+               CtdlRegisterProtoHook(cmd_isme, "ISME", "Determine whether an email address belongs to a user");
+       }
 
         /* return our Subversion id for the Log */
        return "$Id$";