]> granicus.if.org Git - neomutt/commitdiff
When postponing, encode descriptions before encrypting
authorKevin McCarthy <kevin@8t8.us>
Thu, 20 Dec 2018 01:43:26 +0000 (17:43 -0800)
committerRichard Russon <rich@flatcap.org>
Mon, 7 Jan 2019 15:09:41 +0000 (15:09 +0000)
This matches the behavior of the normal send process.  I don't think
there is actually an issue here since nothing is sent, but it makes
sense to be consistent.

Co-authored-by: Richard Russon <rich@flatcap.org>
send.c

diff --git a/send.c b/send.c
index abea1323b8fd28fb1aff3a000abfefad1d90aa02..0f978d039306ebc0802a4d5b2ac1f7469557b904 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1652,10 +1652,11 @@ static int postpone_message(struct Email *msg, struct Email *cur, char *fcc, int
   if (!Postponed)
     return -1;
 
-  /* postpone the message until later. */
   if (msg->content->next)
     msg->content = mutt_make_multipart(msg->content);
 
+  mutt_encode_descriptions(msg->content, true);
+
   if ((WithCrypto != 0) && PostponeEncrypt && (msg->security & ENCRYPT))
   {
     if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
@@ -1678,12 +1679,15 @@ static int postpone_message(struct Email *msg, struct Email *cur, char *fcc, int
           msg->security |= SIGN;
         FREE(&pgpkeylist);
         msg->content = mutt_remove_multipart(msg->content);
+        decode_descriptions(msg->content);
         return -1;
       }
 
       if (is_signed)
         msg->security |= SIGN;
       FREE(&pgpkeylist);
+
+      mutt_encode_descriptions(msg->content, false);
     }
   }
 
@@ -1693,7 +1697,6 @@ static int postpone_message(struct Email *msg, struct Email *cur, char *fcc, int
   msg->read = false;
   msg->old = false;
 
-  mutt_encode_descriptions(msg->content, true);
   mutt_prepare_envelope(msg->env, false);
   mutt_env_to_intl(msg->env, NULL, NULL); /* Handle bad IDNAs the next time. */