]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_chat.c
* Did most of the migration from save_message() to CtdlSaveMsg(). The
[citadel.git] / citadel / serv_chat.c
index 27c6449386f32c9c5f4f8fbf19a768c316005341..197ace6dd1e19c32be44b4e9401ce581b3b5e0d4 100644 (file)
@@ -42,29 +42,15 @@ int ChatLastMsg = 0;
 
 extern struct CitContext *ContextList;
 
-#define MODULE_NAME    "Chat module"
-#define MODULE_AUTHOR  "Art Cancro"
-#define MODULE_EMAIL   "ajc@uncnsrd.mt-kisco.ny.us"
-#define MAJOR_VERSION  2
-#define MINOR_VERSION  0
-
-static struct DLModule_Info info =
-{
-       MODULE_NAME,
-       MODULE_AUTHOR,
-       MODULE_EMAIL,
-       MAJOR_VERSION,
-       MINOR_VERSION
-};
-
-struct DLModule_Info *Dynamic_Module_Init(void)
+char *Dynamic_Module_Init(void)
 {
        CtdlRegisterProtoHook(cmd_chat, "CHAT", "Begin real-time chat");
        CtdlRegisterProtoHook(cmd_pexp, "PEXP", "Poll for express messages");
        CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get express messages");
        CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an express message");
        CtdlRegisterSessionHook(delete_express_messages, EVT_STOP);
-       return &info;
+       CtdlRegisterXmsgHook(send_express_message, XMSG_PRI_LOCAL);
+       return "$Id$";
 }
 
 void allwrite(char *cmdbuf, int flag, char *roomname, char *username)
@@ -510,7 +496,11 @@ int send_express_message(char *lun, char *x_user, char *x_msg)
        }
        end_critical_section(S_SESSION_TABLE);
 
-       /* Log the page to disk if configured to do so */
+       /* Log the page to disk if configured to do so 
+
+
+       ****** FIX FIX FIX   add this back in *************
+
        if ((strlen(config.c_logpages) > 0) && (do_send) ) {
                fp = fopen(CC->temp, "wb");
                fprintf(fp, "%c%c%c", 255, MES_NORMAL, 0);
@@ -525,6 +515,7 @@ int send_express_message(char *lun, char *x_user, char *x_msg)
                save_message(CC->temp, "", config.c_logpages, MES_LOCAL, 1);
                unlink(CC->temp);
        }
+       *************************************/
        return (message_sent);
 }
 
@@ -563,7 +554,7 @@ void cmd_sexp(char *argbuf)
        }
        /* This loop handles text-transfer pages */
        if (!strcmp(x_msg, "-")) {
-               message_sent = send_express_message(lun, x_user, "");
+               message_sent = PerformXmsgHooks(lun, x_user, "");
                if (message_sent == 0) {
                        cprintf("%d No user '%s' logged in.\n", ERROR, x_user);
                        return;
@@ -580,12 +571,12 @@ void cmd_sexp(char *argbuf)
                                strcat(x_big_msgbuf, "\n");
                        strcat(x_big_msgbuf, x_msg);
                }
-               send_express_message(lun, x_user, x_big_msgbuf);
+               PerformXmsgHooks(lun, x_user, x_big_msgbuf);
                phree(x_big_msgbuf);
 
                /* This loop handles inline pages */
        } else {
-               message_sent = send_express_message(lun, x_user, x_msg);
+               message_sent = PerformXmsgHooks(lun, x_user, x_msg);
 
                if (message_sent > 0) {
                        if (strlen(x_msg) > 0)