]> code.citadel.org Git - citadel.git/commitdiff
* small fix to previous commit
authorArt Cancro <ajc@citadel.org>
Fri, 22 Apr 2005 00:52:03 +0000 (00:52 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 22 Apr 2005 00:52:03 +0000 (00:52 +0000)
citadel/ChangeLog
citadel/msgbase.c

index 883bed0d8056038b1ec0038c04b1bf25989805d9..c4cd8b67a68099a5523b1c4436ee8b325fe90994 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 645.7  2005/04/22 00:52:03  ajc
+ * small fix to previous commit
+
  Revision 645.6  2005/04/21 17:28:51  ajc
  * msgbase.c: when committing a new message to the store, save its RFC822
    length to the metadata record immediately.  This will eliminate the need
@@ -6606,3 +6609,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 3de8d06348bf2071b3cedae9f7d7bd3ffecbb282..8808751314276648f771d7e1a516360fbff732e2 100644 (file)
@@ -2042,7 +2042,19 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,      /* message to save */
        newmsgid = send_message(msg);
        if (newmsgid <= 0L) return(-5);
 
-       /* Measure how big this message will be when displayed as RFC822.
+       /* Write a supplemental message info record.  This doesn't have to
+        * be a critical section because nobody else knows about this message
+        * yet.
+        */
+       lprintf(CTDL_DEBUG, "Creating MetaData record\n");
+       memset(&smi, 0, sizeof(struct MetaData));
+       smi.meta_msgnum = newmsgid;
+       smi.meta_refcount = 0;
+       safestrncpy(smi.meta_content_type, content_type,
+                       sizeof smi.meta_content_type);
+
+       /* As part of the new metadata record, measure how
+        * big this message will be when displayed as RFC822.
         * Both POP and IMAP use this, and it's best to just take the hit now
         * instead of having to potentially measure thousands of messages when
         * a mailbox is opened later.
@@ -2061,17 +2073,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,      /* message to save */
        CC->redirect_buffer = NULL;
        CC->redirect_len = 0;
        CC->redirect_alloc = 0;
-       lprintf(CTDL_DEBUG, "Storing meta rfc822 length of %ld\n", smi.meta_rfc822_length);
 
-       /* Write a supplemental message info record.  This doesn't have to
-        * be a critical section because nobody else knows about this message
-        * yet.
-        */
-       lprintf(CTDL_DEBUG, "Creating MetaData record\n");
-       memset(&smi, 0, sizeof(struct MetaData));
-       smi.meta_msgnum = newmsgid;
-       smi.meta_refcount = 0;
-       safestrncpy(smi.meta_content_type, content_type, sizeof smi.meta_content_type);
        PutMetaData(&smi);
 
        /* Now figure out where to store the pointers */
@@ -2084,7 +2086,8 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        if ((!CC->internal_pgm) || (recps == NULL)) {
                if (CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0) != 0) {
                        lprintf(CTDL_ERR, "ERROR saving message pointer!\n");
-                       CtdlSaveMsgPointerInRoom(config.c_aideroom, newmsgid, 0);
+                       CtdlSaveMsgPointerInRoom(config.c_aideroom,
+                                                       newmsgid, 0);
                }
        }
 
@@ -2098,8 +2101,9 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        if (recps != NULL)
         if (recps->num_room > 0)
          for (i=0; i<num_tokens(recps->recp_room, '|'); ++i) {
-               extract_token(recipient, recps->recp_room, i, '|', sizeof recipient);
-               lprintf(CTDL_DEBUG, "Delivering to local room <%s>\n", recipient);
+               extract_token(recipient, recps->recp_room, i,
+                                       '|', sizeof recipient);
+               lprintf(CTDL_DEBUG, "Delivering to room <%s>\n", recipient);
                CtdlSaveMsgPointerInRoom(recipient, newmsgid, 0);
        }
 
@@ -2115,17 +2119,20 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        if (recps != NULL)
         if (recps->num_local > 0)
          for (i=0; i<num_tokens(recps->recp_local, '|'); ++i) {
-               extract_token(recipient, recps->recp_local, i, '|', sizeof recipient);
+               extract_token(recipient, recps->recp_local, i,
+                                       '|', sizeof recipient);
                lprintf(CTDL_DEBUG, "Delivering private local mail to <%s>\n",
                        recipient);
                if (getuser(&userbuf, recipient) == 0) {
-                       MailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM);
+                       MailboxName(actual_rm, sizeof actual_rm,
+                                       &userbuf, MAILROOM);
                        CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0);
                        BumpNewMailCounter(userbuf.usernum);
                }
                else {
                        lprintf(CTDL_DEBUG, "No user <%s>\n", recipient);
-                       CtdlSaveMsgPointerInRoom(config.c_aideroom, newmsgid, 0);
+                       CtdlSaveMsgPointerInRoom(config.c_aideroom,
+                                                       newmsgid, 0);
                }
        }
 
@@ -2144,7 +2151,8 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        if (recps != NULL)
         if (recps->num_ignet > 0)
          for (i=0; i<num_tokens(recps->recp_ignet, '|'); ++i) {
-               extract_token(recipient, recps->recp_ignet, i, '|', sizeof recipient);
+               extract_token(recipient, recps->recp_ignet, i,
+                               '|', sizeof recipient);
 
                hold_R = msg->cm_fields['R'];
                hold_D = msg->cm_fields['D'];