<<< Date Index >>>     <<< Thread Index >>>

Replying to multiple mails



In the changeset 5457 the behavior when answering to multiple mails was
changed so that only one message id is included in the In-Reply-To list.
Up to ten message id can be included in the References list.

http://dev.mutt.org/hg/mutt/rev/7729b1ad530c
changeset:   5457:7729b1ad530c
branch:      HEAD
tag:         tip
user:        Aron Griffis <agriffis@xxxxxxxxx>
date:        Thu Jul 10 09:38:25 2008 -0400
summary:     Unify mutt_write_references

I don't know if this was the intention. You can still tag a couple of
messages and reply to them. The References field becomes correct, but
the In-Reply-To does not.


I enclose four patches related to this problem (which should be able to
be applied seperately).

The first one changes the number of In-Reply-To members to five (rather
arbitrary).

The second patch removes duplicated members in the References field.

The third patch employs mutt_write_references when copying the
In-Reply-To list.

The fourth patch puts the new-line into mutt_write_references in the
same way as mutt_write_address_list does.


Anders

-- 
Anders Helmersson      phone:  +46-13-157 888
Spångerumsgatan 33     mobile: +46-739 874 328
SE-587 25 Linköping    email: anders.helmersson.utsikt@xxxxxxxxxxxx
Sweden                 PGP/GPG key: 1024D/2AD939A8
# HG changeset patch
# User Anders Helmersson <anders.helmersson.utsikt@xxxxxxxxxxxx>
# Date 1223458445 -7200
# Branch multiple-replies
# Node ID ab072da5f90d9238426a6870f44459984736c172
# Parent  10a1f06bc8aa0233841682fad1a967fe2d0141b6
allow more than one (up to 5) message-id in In-reply-to

diff -r 10a1f06bc8aa -r ab072da5f90d sendlib.c
--- a/sendlib.c Tue Oct 07 19:22:53 2008 -0700
+++ b/sendlib.c Wed Oct 08 11:34:05 2008 +0200
@@ -1835,7 +1835,7 @@
   if (env->in_reply_to)
   {
     fputs ("In-Reply-To:", fp);
-    mutt_write_references (env->in_reply_to, fp, 1);
+    mutt_write_references (env->in_reply_to, fp, 5);
     fputc ('\n', fp);
   }
   
# HG changeset patch
# User Anders Helmersson <anders.helmersson.utsikt@xxxxxxxxxxxx>
# Date 1223458522 -7200
# Branch multiple-replies
# Node ID f40ffc4851ca0f426c16129538249202d6346807
# Parent  ab072da5f90d9238426a6870f44459984736c172
remove repeated message-ids in References list

diff -r ab072da5f90d -r f40ffc4851ca sendlib.c
--- a/sendlib.c Wed Oct 08 11:34:05 2008 +0200
+++ b/sendlib.c Wed Oct 08 11:35:22 2008 +0200
@@ -1527,12 +1527,18 @@
 {
   LIST **ref = NULL;
   int refcnt = 0, refmax = 0;
+  int i;
 
   for ( ; (trim == 0 || refcnt < trim) && r ; r = r->next)
   {
     if (refcnt == refmax)
       safe_realloc (&ref, (refmax += REF_INC) * sizeof (LIST *));
-    ref[refcnt++] = r;
+    /* check if ref is already in th list, then discard it */
+    for (i = 0; i < refcnt; i++)
+    {
+      if (mutt_strcmp (r->data, ref[i]->data) == 0) break;
+    }
+    if (i == refcnt) ref[refcnt++] = r;
   }
 
   while (refcnt-- > 0)
# HG changeset patch
# User Anders Helmersson <anders.helmersson.utsikt@xxxxxxxxxxxx>
# Date 1223458596 -7200
# Branch multiple-replies
# Node ID deb1b8698f81a6ec24f685b97d3ee07ecbc9e80a
# Parent  f40ffc4851ca0f426c16129538249202d6346807
use mutt_write_references when copying In-reply-to list

diff -r f40ffc4851ca -r deb1b8698f81 copy.c
--- a/copy.c    Wed Oct 08 11:35:22 2008 +0200
+++ b/copy.c    Wed Oct 08 11:36:36 2008 +0200
@@ -364,13 +364,8 @@
 
   if ((flags & CH_UPDATE_IRT) && h->env->in_reply_to)
   {
-    LIST *listp = h->env->in_reply_to;
     fputs ("In-Reply-To:", out);
-    for (; listp; listp = listp->next)
-    {
-      fputc (' ', out);
-      fputs (listp->data, out);
-    }
+    mutt_write_references (h->env->in_reply_to, out, 0);
     fputc ('\n', out);
   }
 
# HG changeset patch
# User Anders Helmersson <anders.helmersson.utsikt@xxxxxxxxxxxx>
# Date 1223458822 -7200
# Branch multiple-replies
# Node ID 704fc1e33e2cca494d1fa7350f3d9de79203b9d7
# Parent  deb1b8698f81a6ec24f685b97d3ee07ecbc9e80a
move writing of newline into mutt_write_references

diff -r deb1b8698f81 -r 704fc1e33e2c copy.c
--- a/copy.c    Wed Oct 08 11:36:36 2008 +0200
+++ b/copy.c    Wed Oct 08 11:40:22 2008 +0200
@@ -366,14 +366,12 @@
   {
     fputs ("In-Reply-To:", out);
     mutt_write_references (h->env->in_reply_to, out, 0);
-    fputc ('\n', out);
   }
 
   if ((flags & CH_UPDATE_REFS) && h->env->references)
   {
     fputs ("References:", out);
     mutt_write_references (h->env->references, out, 0);
-    fputc ('\n', out);
   }
 
   if ((flags & CH_UPDATE) && (flags & CH_NOSTATUS) == 0)
diff -r deb1b8698f81 -r 704fc1e33e2c sendlib.c
--- a/sendlib.c Wed Oct 08 11:36:36 2008 +0200
+++ b/sendlib.c Wed Oct 08 11:40:22 2008 +0200
@@ -1546,6 +1546,7 @@
     fputc (' ', f);
     fputs (ref[refcnt]->data, f);
   }
+  fputc ('\n', f);
 
   FREE (&ref);
 }
@@ -1830,7 +1831,6 @@
     {
       fputs ("References:", fp);
       mutt_write_references (env->references, fp, 10);
-      fputc('\n', fp);
     }
 
     /* Add the MIME headers */
@@ -1842,7 +1842,6 @@
   {
     fputs ("In-Reply-To:", fp);
     mutt_write_references (env->in_reply_to, fp, 5);
-    fputc ('\n', fp);
   }
   
   /* Add any user defined headers */