]> code.citadel.org Git - citadel.git/commitdiff
text client, enter message, send reply references during pre-compose security check
authorArt Cancro <ajc@citadel.org>
Tue, 14 Sep 2010 15:19:27 +0000 (11:19 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 14 Sep 2010 15:19:27 +0000 (11:19 -0400)
citadel/textclient/messages.c

index 111bac6c47b7cf51958a344909010ddf2412230e..3359d75144c51512192a159f77be4a89c7022e57 100644 (file)
@@ -1117,6 +1117,37 @@ int entmsg(CtdlIPC *ipc,
                newprompt("Display name for this message: ", message.author, 40);
        }
 
                newprompt("Display name for this message: ", message.author, 40);
        }
 
+       if (is_reply) {
+
+               if (!IsEmptyStr(reply_subject)) {
+                       if (!strncasecmp(reply_subject,
+                          "Re: ", 3)) {
+                               strcpy(message.subject, reply_subject);
+                       }
+                       else {
+                               snprintf(message.subject,
+                                       sizeof message.subject,
+                                       "Re: %s",
+                                       reply_subject);
+                       }
+               }
+
+               /* Trim down excessively long lists of thread references.  We eliminate the
+                * second one in the list so that the thread root remains intact.
+                */
+               int rrtok = num_tokens(reply_references, '|');
+               int rrlen = strlen(reply_references);
+               if ( ((rrtok >= 3) && (rrlen > 900)) || (rrtok > 10) ) {
+                       remove_token(reply_references, 1, '|');
+               }
+
+               snprintf(message.references, sizeof message.references, "%s%s%s",
+                       reply_references,
+                       (IsEmptyStr(reply_references) ? "" : "|"),
+                       reply_inreplyto
+               );
+       }
+
        r = CtdlIPCPostMessage(ipc, 0, &subject_required, &message, buf);
 
        if (r / 100 != 2 && r / 10 != 57) {
        r = CtdlIPCPostMessage(ipc, 0, &subject_required, &message, buf);
 
        if (r / 100 != 2 && r / 10 != 57) {
@@ -1154,37 +1185,6 @@ int entmsg(CtdlIPC *ipc,
        }
        strcpy(message.recipient, buf);
 
        }
        strcpy(message.recipient, buf);
 
-       if (is_reply) {
-
-               if (!IsEmptyStr(reply_subject)) {
-                       if (!strncasecmp(reply_subject,
-                          "Re: ", 3)) {
-                               strcpy(message.subject, reply_subject);
-                       }
-                       else {
-                               snprintf(message.subject,
-                                       sizeof message.subject,
-                                       "Re: %s",
-                                       reply_subject);
-                       }
-               }
-
-               /* Trim down excessively long lists of thread references.  We eliminate the
-                * second one in the list so that the thread root remains intact.
-                */
-               int rrtok = num_tokens(reply_references, '|');
-               int rrlen = strlen(reply_references);
-               if ( ((rrtok >= 3) && (rrlen > 900)) || (rrtok > 10) ) {
-                       remove_token(reply_references, 1, '|');
-               }
-
-               snprintf(message.references, sizeof message.references, "%s%s%s",
-                       reply_references,
-                       (IsEmptyStr(reply_references) ? "" : "|"),
-                       reply_inreplyto
-               );
-       }
-
        if (room_flags & QR_ANONOPT) {
                scr_printf("Anonymous (Y/N)? ");
                if (yesno() == 1)
        if (room_flags & QR_ANONOPT) {
                scr_printf("Anonymous (Y/N)? ");
                if (yesno() == 1)