]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_chat.c
* added a comment infront of the svn modifieable returns. Now it will be me listed...
[citadel.git] / citadel / serv_chat.c
index fd941f51643d8f676b9e3b3bef71697d71478787..765d486d9a51d347d71f142a4b3f5d5f0034afac 100644 (file)
@@ -319,7 +319,7 @@ void cmd_chat(char *argbuf)
                                        if (is_room_aide()) {
                                                cprintf(":|/kick   (kick another user out of this room) \n");
                                        }
-                                       cprintf(":|/quit   (return to the BBS) \n");
+                                       cprintf(":|/quit   (exit from this chat) \n");
                                        cprintf(":|\n");
                                        ok_cmd = 1;
                                }
@@ -456,7 +456,7 @@ void cmd_pexp(char *argbuf)
                        cprintf("Message ");
                cprintf("from %s:\n", ptr->sender);
                if (ptr->text != NULL)
-                       memfmout(80, ptr->text, 0, "\n");
+                       memfmout(ptr->text, 0, "\n");
 
                holdptr = ptr->next;
                if (ptr->text != NULL) free(ptr->text);
@@ -486,15 +486,18 @@ void cmd_gexp(char *argbuf) {
        cprintf("%d %d|%ld|%d|%s|%s\n",
                LISTING_FOLLOWS,
                ((ptr->next != NULL) ? 1 : 0),          /* more msgs? */
-               (long)ptr->timestamp,                           /* time sent */
+               (long)ptr->timestamp,                   /* time sent */
                ptr->flags,                             /* flags */
                ptr->sender,                            /* sender of msg */
-               config.c_nodename);                     /* static for now */
+               config.c_nodename                       /* static for now */
+       );
+
        if (ptr->text != NULL) {
-               memfmout(80, ptr->text, 0, "\n");
+               memfmout(ptr->text, 0, "\n");
                if (ptr->text[strlen(ptr->text)-1] != '\n') cprintf("\n");
                free(ptr->text);
-               }
+       }
+
        cprintf("000\n");
        free(ptr);
 }
@@ -554,7 +557,6 @@ void add_xmsg_to_context(struct CitContext *ccptr,
 int send_instant_message(char *lun, char *x_user, char *x_msg)
 {
        int message_sent = 0;           /* number of successful sends */
-
        struct CitContext *ccptr;
        struct ExpressMessage *newmsg;
        char *un;
@@ -564,22 +566,24 @@ int send_instant_message(char *lun, char *x_user, char *x_msg)
                                         */
        struct savelist *sl = NULL;     /* list of rooms to save this page */
        struct savelist *sptr;
-       struct CtdlMessage *logmsg;
+       struct CtdlMessage *logmsg = NULL;
        long msgnum;
 
        if (strlen(x_msg) > 0) {
                msglen = strlen(x_msg) + 4;
                do_send = 1;
-               }
+       }
 
        /* find the target user's context and append the message */
        begin_critical_section(S_SESSION_TABLE);
        for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
 
-               if (ccptr->fake_username[0])    /* <bc> */
+               if (ccptr->fake_username[0]) {
                        un = ccptr->fake_username;
-               else
+               }
+               else {
                        un = ccptr->user.fullname;
+               }
 
                if ( ((!strcasecmp(un, x_user))
                    || (!strcasecmp(x_user, "broadcast")))
@@ -639,7 +643,7 @@ int send_instant_message(char *lun, char *x_user, char *x_msg)
                /* Now save a copy in the global log room, if configured */
                if (strlen(config.c_logpages) > 0) {
                        create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
-                       CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0);
+                       CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0, NULL);
                }
 
                /* Save a copy in each recipient's log room, creating those
@@ -649,7 +653,7 @@ int send_instant_message(char *lun, char *x_user, char *x_msg)
                 */
                while (sl != NULL) {
                        create_room(sl->roomname, 5, "", 0, 1, 1, VIEW_BBS);
-                       CtdlSaveMsgPointerInRoom(sl->roomname, msgnum, 0);
+                       CtdlSaveMsgPointerInRoom(sl->roomname, msgnum, 0, NULL);
                        sptr = sl->next;
                        free(sl);
                        sl = sptr;
@@ -662,14 +666,14 @@ int send_instant_message(char *lun, char *x_user, char *x_msg)
 }
 
 /*
- * send instant messages  <bc>
+ * send instant messages
  */
 void cmd_sexp(char *argbuf)
 {
        int message_sent = 0;
        char x_user[USERNAME_SIZE];
        char x_msg[1024];
-       char *lun;              /* <bc> */
+       char *lun;
        char *x_big_msgbuf = NULL;
 
        if ((!(CC->logged_in)) && (!(CC->internal_pgm))) {
@@ -817,6 +821,8 @@ char *serv_chat_init(void)
        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$";
 }