]> granicus.if.org Git - mutt/commitdiff
[unstable] Re-add in-reply-to. This time with a suitable default. #-\
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 30 Sep 1999 19:47:19 +0000 (19:47 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 30 Sep 1999 19:47:19 +0000 (19:47 +0000)
globals.h
init.h
send.c

index 668e2109e67e3dd53a606cdfa75f821ec59d5237..7571533b28e4950fd34777ffafc8b90c45f07a3e 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -53,6 +53,7 @@ WHERE char *ImapPass INITVAL (NULL);
 WHERE short ImapCheckTimeout;
 WHERE char *ImapHomeNamespace INITVAL (NULL);
 #endif
+WHERE char *InReplyTo;
 WHERE char *Inbox;
 WHERE char *Ispell;
 WHERE char *Locale;
diff --git a/init.h b/init.h
index 1e0c30ffc33a27d074aa8485fedd1dacc9bb00a9..aa708714591bf3c38a38fb1ad2ce9ad9febaeab0 100644 (file)
--- a/init.h
+++ b/init.h
@@ -686,6 +686,17 @@ struct option_t MuttVars[] = {
   ** message to which you are replying.  You are strongly encouraged not to
   ** change this value, as it tends to agitate the more fanatical netizens.
   */
+  { "in_reply_to",     DT_STR,  R_NONE, UL &InReplyTo, UL "%i; from %a on %{!%a, %b %d, %Y at %I:%M:%S%p %Z}" },
+  /*
+  ** .pp
+  ** This specifies the format of the \fIIn-Reply-To\fP header field
+  ** added when replying to a message.  For a ful llisting of
+  ** defined escape sequences, ese the section on $$index_format.
+  ** .pp
+  ** \fBNote:\fP Don't use any sequences in this format string which
+  ** may include 8-bit characters.  Using such escape sequences may
+  ** lead to bad headers.
+  */
   { "indent_str",      DT_SYN,  R_NONE, UL "indent_string", 0 },
   /*
   */
diff --git a/send.c b/send.c
index f2249697e812d2b86b57eb9481b0d2bf100bb2f2..83824767fc3551fe8430c0e4f8c31dfe5b0fdea3 100644 (file)
--- a/send.c
+++ b/send.c
@@ -580,20 +580,22 @@ envelope_defaults (ENVELOPE *env, CONTEXT *ctx, HEADER *cur, int flags)
       env->subject = safe_strdup ("Re: your mail");
 
     /* add the In-Reply-To field */
-    snprintf (buffer, sizeof (buffer), "In-Reply-To: %s", 
-             cur->env->message_id);
-
-    tmp = env->userhdrs;
-    while (tmp && tmp->next)
-      tmp = tmp->next;
-    if (tmp)
+    if (InReplyTo)
     {
-      tmp->next = mutt_new_list ();
-      tmp = tmp->next;
+      strfcpy (buffer, "In-Reply-To: ", sizeof (buffer));
+      mutt_make_string (buffer + 13, sizeof (buffer) - 13, InReplyTo, ctx, cur);
+      tmp = env->userhdrs;
+      while (tmp && tmp->next)
+       tmp = tmp->next;
+      if (tmp)
+      {
+       tmp->next = mutt_new_list ();
+       tmp = tmp->next;
+      }
+      else
+       tmp = env->userhdrs = mutt_new_list ();
+      tmp->data = safe_strdup (buffer);
     }
-    else
-      tmp = env->userhdrs = mutt_new_list ();
-    tmp->data = safe_strdup (buffer);
 
     if(tag)
     {