Only check for multiple in-reply-to when there is more than one tagged
message.  Otherwise, why aren't we scanning the case where no message
is tagged and we are replying to a single message?

Add the same check to the recvattach menu too.
---
 recvcmd.c | 6 ++++++
 send.c    | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/recvcmd.c b/recvcmd.c
index a5fc5c8a..d61b4191 100644
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -882,12 +882,18 @@ attach_reply_envelope_defaults(ENVELOPE *env, 
ATTACH_CONTEXT *actx,
   else
   {
     LIST **p = NULL, **q = NULL;
+    int tagged = 0;
 
     for (i = 0; i < actx->idxlen; i++)
     {
       if (actx->idx[i]->content->tagged)
+      {
+        tagged++;
         mutt_add_to_reference_headers(env, actx->idx[i]->content->hdr->env, 
&p, &q);
+      }
     }
+    if (tagged > 1 && env->in_reply_to && env->in_reply_to->next)
+      mutt_free_list(&env->references);
   }
 
   return 0;
diff --git a/send.c b/send.c
index 65445b1c..815a8afe 100644
--- a/send.c
+++ b/send.c
@@ -827,7 +827,7 @@ mutt_make_reference_headers(ENVELOPE *curenv, ENVELOPE 
*env, CONTEXT *ctx)
   /* if there's more than entry in In-Reply-To (i.e. message has
      multiple parents), don't generate a References: header as it's
      discouraged by RfC2822, sect. 3.6.4 */
-  if (ctx->tagged > 0 && env->in_reply_to && env->in_reply_to->next)
+  if (ctx->tagged > 1 && env->in_reply_to && env->in_reply_to->next)
     mutt_free_list(&env->references);
 }
 
-- 
2.55.0

Reply via email to