]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
IMPORTANT FIX TO VCARD / GLOBAL ADDRESS BOOK ROOM. VERSION UPDATE TO 8.03. DEPLOY...
[citadel.git] / citadel / msgbase.c
index d88bef4a6f3e041ac082a8f9c07ff4e22634d29e..c583263eb4ebc19220aa72a3660637dcff0ca1b6 100644 (file)
@@ -1354,7 +1354,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
                ptr = html_to_ascii(content, length, 80, 0);
                wlen = strlen(ptr);
                client_write(ptr, wlen);
-               if (ptr[wlen-1] != '\n') {
+               if ((wlen > 0) && (ptr[wlen-1] != '\n')) {
                        cprintf("\n");
                }
                free(ptr);
@@ -3261,14 +3261,18 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
                        }
                        else {
                                syslog(LOG_DEBUG, "No user <%s>\n", recipient);
-                               CtdlSaveMsgPointerInRoom(config.c_aideroom,
-                                                        newmsgid, 0, msg);
+                               CtdlSaveMsgPointerInRoom(config.c_aideroom, newmsgid, 0, msg);
                        }
                }
 
        /* Perform "after save" hooks */
        syslog(LOG_DEBUG, "Performing after-save hooks\n");
+       if (msg->cm_fields['3'] != NULL) free(msg->cm_fields['3']);
+       msg->cm_fields['3'] = malloc(20);
+       snprintf(msg->cm_fields['3'], 20, "%ld", newmsgid);
        PerformMessageHooks(msg, EVT_AFTERSAVE);
+       free(msg->cm_fields['3']);
+       msg->cm_fields['3'] = NULL;
 
        /* For IGnet mail, we have to save a new copy into the spooler for
         * each recipient, with the R and D fields set to the recipient and
@@ -4543,11 +4547,11 @@ void cmd_ent0(char *entargs)
                {
                        if (StrLength(CCC->StatusMessage)>0)
                        {
-                               StrBufAppendBufPlain(CCC->StatusMessage, HKEY("\n"), 0);
+                               StrBufAppendBufPlain(CCC->StatusMessage, HKEY("\n000\n"), 0);
                                cputbuf(CCC->StatusMessage);
                        }
                        else
-                               client_write(HKEY("\n"));
+                               client_write(HKEY("\n000\n"));
                }
 
                if (do_confirm) {