Ticket #3090: mutt-3090-references.patch
| File mutt-3090-references.patch, 23.6 kB (added by Aron Griffis, 6 months ago) |
|---|
-
Makefile.am
diff -r f72fce68ca19 Makefile.am
a b 24 24 getdomain.c group.c \ 25 25 handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \ 26 26 main.c mbox.c menu.c mh.c mx.c pager.c parse.c pattern.c \ 27 postpone.c query.c recvattach.c recvcmd.c \27 postpone.c query.c recvattach.c recvcmd.c references.c \ 28 28 rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ 29 29 score.c send.c sendlib.c signal.c sort.c \ 30 30 status.c system.c thread.c charset.c history.c lib.c \ -
copy.c
diff -r f72fce68ca19 copy.c
a b 370 370 { 371 371 if ((flags & CH_NOSTATUS) == 0) 372 372 { 373 if (h->env->irt_changed && h->env->in_reply_to)373 if (h->env->irt_changed) 374 374 { 375 LIST *listp = h->env->in_reply_to; 376 377 if (fputs ("In-Reply-To: ", out) == EOF) 378 return (-1); 379 380 for (; listp; listp = listp->next) 381 if ((fputs (listp->data, out) == EOF) || (fputc (' ', out) == EOF)) 382 return (-1); 383 384 if (fputc ('\n', out) == EOF) 385 return (-1); 375 char *s = mutt_in_reply_to_str(h->env); 376 if (s && fprintf (out, "In-Reply-To: %s\n", s) < 0) 377 return -1; 386 378 } 387 379 388 if (h->env->refs_changed && h->env->references)380 if (h->env->refs_changed) 389 381 { 390 LIST *listp = h->env->references, *refs = NULL, *t; 391 392 if (fputs ("References: ", out) == EOF) 393 return (-1); 394 395 /* Mutt stores references in reverse order, thus we create 396 * a reordered refs list that we can put in the headers */ 397 for (; listp; listp = listp->next, refs = t) 398 { 399 t = (LIST *)safe_malloc (sizeof (LIST)); 400 t->data = listp->data; 401 t->next = refs; 402 } 403 404 for (; refs; refs = refs->next) 405 if ((fputs (refs->data, out) == EOF) || (fputc (' ', out) == EOF)) 406 return (-1); 407 408 /* clearing refs from memory */ 409 for (t = refs; refs; refs = t->next, t = refs) 410 FREE (&refs); 411 412 if (fputc ('\n', out) == EOF) 413 return (-1); 382 char *s = mutt_references_str(h->env, 0); 383 if (s && fprintf (out, "References: %s\n", s) < 0) 384 return -1; 414 385 } 415 386 416 387 if (h->old || h->read) -
hcache.c
diff -r f72fce68ca19 hcache.c
a b 423 423 424 424 d = dump_buffer(e->spam, d, off, convert); 425 425 426 d = dump_ list(e->references, d, off, 0);427 d = dump_ list(e->in_reply_to, d, off, 0);426 d = dump_char(mutt_references_str(e, 0), d, off, convert); 427 d = dump_char(mutt_in_reply_to_str(e), d, off, convert); 428 428 d = dump_list(e->userhdrs, d, off, convert); 429 429 430 430 return d; … … 460 460 461 461 restore_buffer(&e->spam, d, off, convert); 462 462 463 restore_ list(&e->references, d, off, 0);464 restore_ list(&e->in_reply_to, d, off, 0);463 restore_char(&e->references_s, d, off, convert); 464 restore_char(&e->in_reply_to_s, d, off, convert); 465 465 restore_list(&e->userhdrs, d, off, convert); 466 466 } 467 467 -
headers.c
diff -r f72fce68ca19 headers.c
a b 111 111 mutt_unlink (path); 112 112 113 113 /* restore old info. */ 114 n->references = msg->env->references; 115 msg->env->references = NULL; 114 mutt_move_references (n, msg->env); 116 115 117 116 mutt_free_envelope (&msg->env); 118 117 msg->env = n; n = NULL; 119 118 120 if (!m sg->env->in_reply_to)121 mutt_free_ list (&msg->env->references);119 if (!mutt_has_in_reply_to(msg->env)) 120 mutt_free_references (msg->env); 122 121 123 122 mutt_expand_aliases_env (msg->env); 124 123 125 /* search through the user defined headers added to see if either a126 * fcc: or attach-file: field wasspecified.124 /* search through the user defined headers added to see if any of 125 * fcc: or attach-file: or pgp: fields were specified. 127 126 */ 128 127 129 128 cur = msg->env->userhdrs; … … 132 131 { 133 132 keep = 1; 134 133 135 /* keep track of whether or not we see the in-reply-to field. if we did136 * not, remove the references: field later so that we can generate a new137 * message based upon this one.138 */139 134 if (fcc && ascii_strncasecmp ("fcc:", cur->data, 4) == 0) 140 135 { 141 136 p = cur->data + 4; … … 179 174 } 180 175 keep = 0; 181 176 } 182 183 184 177 else if ((WithCrypto & APPLICATION_PGP) 185 178 &&ascii_strncasecmp ("pgp:", cur->data, 4) == 0) 186 179 { -
mbox.c
diff -r f72fce68ca19 mbox.c
a b 466 466 return (1); 467 467 } 468 468 469 static int strict_cmp_lists (const LIST *a, const LIST *b) 470 { 471 while (a && b) 472 { 473 if (mutt_strcmp (a->data, b->data)) 474 return (0); 475 476 a = a->next; 477 b = b->next; 478 } 479 if (a || b) 480 return (0); 481 482 return (1); 483 } 484 485 static int strict_cmp_envelopes (const ENVELOPE *e1, const ENVELOPE *e2) 469 static int strict_cmp_envelopes (ENVELOPE *e1, ENVELOPE *e2) 486 470 { 487 471 if (e1 && e2) 488 472 { 489 473 if (mutt_strcmp (e1->message_id, e2->message_id) || 490 474 mutt_strcmp (e1->subject, e2->subject) || 491 !strict_cmp_lists (e1->references, e2->references) ||475 mutt_strcmp (mutt_references_str(e1, 0), mutt_references_str(e2, 0)) || 492 476 !strict_addrcmp (e1->from, e2->from) || 493 477 !strict_addrcmp (e1->sender, e2->sender) || 494 478 !strict_addrcmp (e1->reply_to, e2->reply_to) || -
mutt.h
diff -r f72fce68ca19 mutt.h
a b 596 596 char *date; 597 597 char *x_label; 598 598 BUFFER *spam; 599 LIST *references; /* message references (in reverse order) */ 600 LIST *in_reply_to; /* in-reply-to header content */ 599 char *references_s; /* references header content */ 600 LIST *references_l; /* references (parsed, in reverse order) */ 601 char *in_reply_to_s; /* in-reply-to header content */ 602 LIST *in_reply_to_l; /* in-reply-to (parsed) */ 601 603 LIST *userhdrs; /* user defined headers */ 602 604 603 605 unsigned int irt_changed : 1; /* In-Reply-To changed to link/break threads */ … … 956 958 957 959 #include "ascii.h" 958 960 #include "protos.h" 961 #include "references.h" 959 962 #include "lib.h" 960 963 #include "globals.h" 961 964 -
muttlib.c
diff -r f72fce68ca19 muttlib.c
a b 677 677 678 678 mutt_buffer_free (&(*p)->spam); 679 679 680 mutt_free_ list (&(*p)->references);681 mutt_free_ list (&(*p)->in_reply_to);680 mutt_free_references (*p); 681 mutt_free_in_reply_to (*p); 682 682 mutt_free_list (&(*p)->userhdrs); 683 683 FREE (p); /* __FREE_CHECKED__ */ 684 684 } … … 703 703 MOVE_ELEM(supersedes); 704 704 MOVE_ELEM(date); 705 705 MOVE_ELEM(x_label); 706 if (!base->refs_changed) 706 707 if (!base->refs_changed && !mutt_has_references(base)) 707 708 { 708 MOVE_ELEM(references); 709 MOVE_ELEM(references_l); 710 MOVE_ELEM(references_s); 709 711 } 710 if (!base->irt_changed) 712 713 if (!base->irt_changed && !mutt_has_in_reply_to(base)) 711 714 { 712 MOVE_ELEM(in_reply_to); 715 MOVE_ELEM(in_reply_to_l); 716 MOVE_ELEM(in_reply_to_s); 713 717 } 714 718 715 719 /* real_subj is subordinate to subject */ 716 720 if (!base->subject) 717 721 { -
parse.c
diff -r f72fce68ca19 parse.c
a b 87 87 } 88 88 } 89 89 /* not reached */ 90 }91 92 static LIST *mutt_parse_references (char *s, int in_reply_to)93 {94 LIST *t, *lst = NULL;95 int m, n = 0;96 char *o = NULL, *new, *at;97 98 while ((s = strtok (s, " \t;")) != NULL)99 {100 /*101 * some mail clients add other garbage besides message-ids, so do a quick102 * check to make sure this looks like a valid message-id103 * some idiotic clients also break their message-ids between lines, deal104 * with that too (give up if it's more than two lines, though)105 */106 t = NULL;107 new = NULL;108 109 if (*s == '<')110 {111 n = strlen (s);112 if (s[n-1] != '>')113 {114 o = s;115 s = NULL;116 continue;117 }118 119 new = safe_strdup (s);120 }121 else if (o)122 {123 m = strlen (s);124 if (s[m - 1] == '>')125 {126 new = safe_malloc (sizeof (char) * (n + m + 1));127 strcpy (new, o); /* __STRCPY_CHECKED__ */128 strcpy (new + n, s); /* __STRCPY_CHECKED__ */129 }130 }131 if (new)132 {133 /* make sure that this really does look like a message-id.134 * it should have exactly one @, and if we're looking at135 * an in-reply-to header, make sure that the part before136 * the @ has more than eight characters or it's probably137 * an email address138 */139 if (!(at = strchr (new, '@')) || strchr (at + 1, '@')140 || (in_reply_to && at - new <= 8))141 FREE (&new);142 else143 {144 t = (LIST *) safe_malloc (sizeof (LIST));145 t->data = new;146 t->next = lst;147 lst = t;148 }149 }150 o = NULL;151 s = NULL;152 }153 154 return (lst);155 90 } 156 91 157 92 int mutt_check_encoding (const char *c) … … 1073 1008 case 'i': 1074 1009 if (!ascii_strcasecmp (line+1, "n-reply-to")) 1075 1010 { 1076 mutt_free_list (&e->in_reply_to); 1077 e->in_reply_to = mutt_parse_references (p, 1); 1011 mutt_free_list (&e->in_reply_to_l); 1012 FREE (&e->in_reply_to_s); 1013 e->in_reply_to_s = safe_strdup (p); 1078 1014 matched = 1; 1079 1015 } 1080 1016 break; … … 1155 1091 case 'r': 1156 1092 if (!ascii_strcasecmp (line + 1, "eferences")) 1157 1093 { 1158 mutt_free_list (&e->references); 1159 e->references = mutt_parse_references (p, 0); 1094 mutt_free_list (&e->references_l); 1095 FREE (&e->references_s); 1096 e->references_s = safe_strdup (p); 1160 1097 matched = 1; 1161 1098 } 1162 1099 else if (!ascii_strcasecmp (line + 1, "eply-to")) -
pattern.c
diff -r f72fce68ca19 pattern.c
a b 1015 1015 return pat->alladdr; /* No matches, or all matches if alladdr */ 1016 1016 } 1017 1017 1018 static int match_reference (pattern_t *pat, LIST *refs)1019 {1020 for (; refs; refs = refs->next)1021 if (patmatch (pat, refs->data) == 0)1022 return 1;1023 return 0;1024 }1025 1026 1018 /* 1027 1019 * Matches subscribed mailing lists 1028 1020 */ … … 1166 1158 case M_SIZE: 1167 1159 return (pat->not ^ (h->content->length >= pat->min && (pat->max == M_MAXRANGE || h->content->length <= pat->max))); 1168 1160 case M_REFERENCE: 1169 return (pat->not ^ match_reference (pat, h->env->references)); 1161 return (pat->not ^ (mutt_references_str (h->env, 0) && 1162 patmatch (pat, mutt_references_str (h->env, 0)) == 0)); 1170 1163 case M_ADDRESS: 1171 1164 return (pat->not ^ match_adrlist (pat, flags & M_MATCH_FULL_ADDRESS, 4, 1172 1165 h->env->from, h->env->sender, -
(a) /dev/null vs. (b) b/references.c
diff -r f72fce68ca19 references.c
a b 1 /* 2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org> 3 * Copyright (C) 2008 Aron Griffis <agriffis@n01se.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 20 #if HAVE_CONFIG_H 21 # include "config.h" 22 #endif 23 24 #include "mutt.h" 25 #include "mutt_regex.h" 26 #include "mailbox.h" 27 #include "mime.h" 28 #include "rfc2047.h" 29 #include "rfc2231.h" 30 #include "mutt_crypt.h" 31 #include "url.h" 32 33 #include <string.h> 34 #include <ctype.h> 35 #include <sys/stat.h> 36 #include <stdlib.h> 37 38 static LIST *mutt_parse_references (char *s, int in_reply_to) 39 { 40 LIST *t, *lst = NULL; 41 int m, n = 0; 42 char *o = NULL, *new, *at; 43 44 while ((s = strtok (s, " \t;")) != NULL) 45 { 46 /* some mail clients add other garbage besides message-ids, so do a quick 47 * check to make sure this looks like a valid message-id 48 * some idiotic clients also break their message-ids between lines, deal 49 * with that too (give up if it's more than two lines, though) 50 */ 51 t = NULL; 52 new = NULL; 53 54 if (*s == '<') 55 { 56 n = strlen (s); 57 if (s[n-1] != '>') 58 { 59 o = s; 60 s = NULL; 61 continue; 62 } 63 64 new = safe_strdup (s); 65 } 66 else if (o) 67 { 68 m = strlen (s); 69 if (s[m - 1] == '>') 70 { 71 new = safe_malloc (sizeof (char) * (n + m + 1)); 72 strcpy (new, o); /* __STRCPY_CHECKED__ */ 73 strcpy (new + n, s); /* __STRCPY_CHECKED__ */ 74 } 75 } 76 if (new) 77 { 78 /* make sure that this really does look like a message-id. 79 * it should have exactly one @, and if we're looking at 80 * an in-reply-to header, make sure that the part before 81 * the @ has more than eight characters or it's probably 82 * an email address 83 */ 84 if (!(at = strchr (new, '@')) || strchr (at + 1, '@') 85 || (in_reply_to && at - new <= 8)) 86 FREE (&new); 87 else 88 { 89 t = (LIST *) safe_malloc (sizeof (LIST)); 90 t->data = new; 91 t->next = lst; 92 lst = t; 93 } 94 } 95 o = NULL; 96 s = NULL; 97 } 98 99 return (lst); 100 } 101 102 LIST *mutt_references_list (ENVELOPE *e) 103 { 104 if (!e->references_l && e->references_s) 105 e->references_l = mutt_parse_references (e->references_s, 0); 106 return e->references_l; 107 } 108 109 LIST *mutt_in_reply_to_list (ENVELOPE *e) 110 { 111 if (!e->in_reply_to_l && e->in_reply_to_s) 112 e->in_reply_to_l = mutt_parse_references (e->in_reply_to_s, 1); 113 return e->in_reply_to_l; 114 } 115 116 LIST **mutt_references_listp (ENVELOPE *e) 117 { 118 /* giving away a pointer invalidates the stored string */ 119 (void) mutt_references_list (e); 120 FREE (&e->references_s); 121 return &e->references_l; 122 } 123 124 LIST **mutt_in_reply_to_listp (ENVELOPE *e) 125 { 126 /* giving away a pointer invalidates the stored string */ 127 (void) mutt_in_reply_to_list (e); 128 FREE (&e->in_reply_to_s); 129 return &e->in_reply_to_l; 130 } 131 132 /* this is a generally useful function that should probably live elsewhere */ 133 static void reverse_list (LIST **list) 134 { 135 LIST *l = *list, *prev = NULL, *next = NULL; 136 if (!l || !l->next) 137 return; 138 do { 139 next = l->next; 140 l->next = prev; 141 prev = l; 142 l = next; 143 } while (l); 144 *list = prev; 145 } 146 147 static char *refs_str (char **sp, LIST *l, int max) 148 { 149 LIST *ref; 150 int len, buflen, count; 151 char *s = NULL; 152 153 /* if no max then preemptively return stored value */ 154 if (!max && *sp) 155 return *sp; 156 157 /* list is stored in reverse order to speed up threading; 158 * switch it forward temporarily. 159 */ 160 reverse_list (&l); 161 162 for (ref = l, count = 0, buflen = 0; 163 ref && (max == 0 || count < max); 164 ref = ref->next, count++) 165 { 166 len = strlen (ref->data); 167 buflen += len + 1; 168 safe_realloc (&s, buflen); 169 memcpy (&s[buflen - len - 1], ref->data, len); 170 s[buflen - 1] = ' '; 171 } 172 if (s) 173 s[buflen - 1] = '\0'; 174 175 /* reverse it back */ 176 reverse_list (&l); 177 178 if (!max) 179 *sp = s; 180 181 return s; 182 } 183 184 char *mutt_references_str (ENVELOPE *e, int max) 185 { 186 if (max) 187 { 188 /* make sure the list is populated, since specifying a max value 189 * forces the list-to-string generation. 190 */ 191 (void) mutt_references_list (e); 192 } 193 return refs_str (&e->references_s, e->references_l, max); 194 } 195 196 char *mutt_in_reply_to_str (ENVELOPE *e) 197 { 198 return refs_str (&e->in_reply_to_s, e->in_reply_to_l, 1); 199 } 200 201 void mutt_move_references (ENVELOPE *to, ENVELOPE *from) 202 { 203 to->references_l = from->references_l; 204 to->references_s = from->references_s; 205 from->references_l = NULL; 206 from->references_s = NULL; 207 } 208 209 void mutt_free_references (ENVELOPE *e) 210 { 211 mutt_free_list (&e->references_l); 212 FREE (&e->references_s); 213 } 214 215 void mutt_free_in_reply_to (ENVELOPE *e) 216 { 217 mutt_free_list (&e->in_reply_to_l); 218 FREE (&e->in_reply_to_s); 219 } 220 221 void mutt_null_references (ENVELOPE *e) 222 { 223 e->references_l = NULL; 224 e->references_s = NULL; 225 } 226 227 void mutt_null_in_reply_to (ENVELOPE *e) 228 { 229 e->in_reply_to_l = NULL; 230 e->in_reply_to_s = NULL; 231 } 232 233 void mutt_set_in_reply_to_s (ENVELOPE *e, char *s) 234 { 235 mutt_free_list (&e->in_reply_to_l); 236 FREE (&e->in_reply_to_s); 237 e->in_reply_to_s = safe_strdup (s); 238 } 239 -
(a) /dev/null vs. (b) b/references.h
diff -r f72fce68ca19 references.h
a b 1 /* 2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org> 3 * Copyright (C) 2008 Aron Griffis <agriffis@n01se.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 20 LIST *mutt_references_list (ENVELOPE *e); 21 LIST **mutt_references_listp (ENVELOPE *e); 22 char *mutt_references_str (ENVELOPE *e, int max); 23 void mutt_null_references (ENVELOPE *e); 24 void mutt_move_references (ENVELOPE *to, ENVELOPE *from); 25 void mutt_free_references (ENVELOPE *e); 26 27 LIST *mutt_in_reply_to_list (ENVELOPE *e); 28 LIST **mutt_in_reply_to_listp (ENVELOPE *e); 29 char *mutt_in_reply_to_str (ENVELOPE *e); 30 void mutt_null_in_reply_to (ENVELOPE *e); 31 void mutt_set_in_reply_to_s (ENVELOPE *e, char *s); 32 void mutt_free_in_reply_to (ENVELOPE *e); 33 34 #define mutt_has_references(e) ((e)->references_s || (e)->references_l) 35 #define mutt_has_in_reply_to(e) ((e)->in_reply_to_s || (e)->in_reply_to_l) -
send.c
diff -r f72fce68ca19 send.c
a b 565 565 { 566 566 LIST *t = NULL, *l = NULL; 567 567 568 if ( e->references)569 l = mutt_copy_list ( e->references);570 else 571 l = mutt_copy_list ( e->in_reply_to);568 if (mutt_has_references (e)) 569 l = mutt_copy_list (mutt_references_list (e)); 570 else if (mutt_has_in_reply_to (e)) 571 l = mutt_copy_list (mutt_in_reply_to_list (e)); 572 572 573 573 if (e->message_id) 574 574 { … … 636 636 if (pp) p = *pp; 637 637 if (qq) q = *qq; 638 638 639 if (!p) p = &env->references; 640 if (!q) q = &env->in_reply_to; 639 /* make sure the lists are populated */ 640 if (!p) p = mutt_references_listp (env); 641 if (!q) q = mutt_in_reply_to_listp (env); 641 642 642 643 while (*p) p = &(*p)->next; 643 644 while (*q) q = &(*q)->next; … … 658 659 static void 659 660 mutt_make_reference_headers (ENVELOPE *curenv, ENVELOPE *env, CONTEXT *ctx) 660 661 { 661 env->references = NULL;662 env->in_reply_to = NULL;662 mutt_null_references (env); 663 mutt_null_in_reply_to (env); 663 664 664 665 if (!curenv) 665 666 { -
sendlib.c
diff -r f72fce68ca19 sendlib.c
a b 1517 1517 fputc ('\n', fp); 1518 1518 } 1519 1519 1520 /* arbitrary number of elements to grow the array by */1521 #define REF_INC 161522 1523 #define TrimRef 101524 1525 /* need to write the list in reverse because they are stored in reverse order1526 * when parsed to speed up threading1527 */1528 static void write_references (LIST *r, FILE *f)1529 {1530 LIST **ref = NULL;1531 int refcnt = 0, refmax = 0;1532 1533 for ( ; (TrimRef == 0 || refcnt < TrimRef) && r ; r = r->next)1534 {1535 if (refcnt == refmax)1536 safe_realloc (&ref, (refmax += REF_INC) * sizeof (LIST *));1537 ref[refcnt++] = r;1538 }1539 1540 while (refcnt-- > 0)1541 {1542 fputc (' ', f);1543 fputs (ref[refcnt]->data, f);1544 }1545 1546 FREE (&ref);1547 }1548 1549 1550 1520 static void foldingstrfcpy (char *d, const char *s, int n) 1551 1521 { 1552 1522 while (--n >= 0 && *s) … … 1822 1792 1823 1793 if (mode <= 0) 1824 1794 { 1825 if (env->references) 1826 { 1827 fputs ("References:", fp); 1828 write_references (env->references, fp); 1829 fputc('\n', fp); 1830 } 1795 if (mutt_has_references (env)) 1796 fprintf (fp, "References: %s\n", mutt_references_str (env, 10)); 1831 1797 1832 1798 /* Add the MIME headers */ 1833 1799 fputs ("MIME-Version: 1.0\n", fp); 1834 1800 mutt_write_mime_header (attach, fp); 1835 1801 } 1836 1802 1837 if (env->in_reply_to) 1838 { 1839 fputs ("In-Reply-To:", fp); 1840 write_references (env->in_reply_to, fp); 1841 fputc ('\n', fp); 1842 } 1803 if (mutt_has_in_reply_to (env)) 1804 fprintf (fp, "In-Reply-To: %s\n", mutt_in_reply_to_str (env)); 1843 1805 1844 1806 /* Add any user defined headers */ 1845 1807 for (; tmp; tmp = tmp->next) -
thread.c
diff -r f72fce68ca19 thread.c
a b 888 888 if (using_refs == 0) 889 889 { 890 890 /* look at the beginning of in-reply-to: */ 891 if ((ref = cur->env->in_reply_to) != NULL)891 if ((ref = mutt_in_reply_to_list (cur->env)) != NULL) 892 892 using_refs = 1; 893 893 else 894 894 { 895 ref = cur->env->references;895 ref = mutt_references_list (cur->env); 896 896 using_refs = 2; 897 897 } 898 898 } … … 904 904 * the second reference (since at least eudora puts the most 905 905 * recent reference in in-reply-to and the rest in references) 906 906 */
