]> granicus.if.org Git - neomutt/commitdiff
Move fcc after send
authorKevin McCarthy <kevin@8t8.us>
Wed, 19 Dec 2018 22:35:22 +0000 (14:35 -0800)
committerRichard Russon <rich@flatcap.org>
Mon, 7 Jan 2019 15:09:41 +0000 (15:09 +0000)
Co-authored-by: Richard Russon <rich@flatcap.org>
send.c

diff --git a/send.c b/send.c
index 952b63bb13630a562e9d6e37acaf99c787b32a6c..25ca2d5c2416b3d85ca959daf865293989f0362f 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1616,7 +1616,6 @@ int ci_send_message(int flags, struct Email *msg, const char *tempfile,
   struct Body *pbody = NULL;
   int i;
   bool killfrom = false;
-  bool fcc_error = false;
   bool free_clear_content = false;
 
   struct Body *clear_content = NULL;
@@ -2137,7 +2136,6 @@ int ci_send_message(int flags, struct Email *msg, const char *tempfile,
   {
   main_loop:
 
-    fcc_error = false; /* reset value since we may have failed before */
     mutt_pretty_mailbox(fcc, sizeof(fcc));
     i = mutt_compose_menu(msg, fcc, sizeof(fcc), cur,
                           ((flags & SEND_NO_FREE_HEADER) ? MUTT_COMPOSE_NOFREEHEADER : 0));
@@ -2340,14 +2338,8 @@ int ci_send_message(int flags, struct Email *msg, const char *tempfile,
 
   mutt_prepare_envelope(msg->env, true);
 
-  fcc_error = (save_fcc(msg, fcc, sizeof(fcc), clear_content, pgpkeylist, flags,
-                        &finalpath) < 0);
-
-  /* Don't attempt to send the message if the FCC failed.  Just pretend
-   * the send failed as well so we give the user a chance to fix the
-   * error.
-   */
-  if (fcc_error || (i = send_message(msg)) < 0)
+  i = send_message(msg);
+  if (i < 0)
   {
     if (!(flags & SEND_BATCH))
     {
@@ -2388,6 +2380,8 @@ int ci_send_message(int flags, struct Email *msg, const char *tempfile,
 #endif
   }
 
+  save_fcc(msg, fcc, sizeof(fcc), clear_content, pgpkeylist, flags, &finalpath);
+
   if ((WithCrypto != 0) && (msg->security & ENCRYPT))
     FREE(&pgpkeylist);