aboutsummaryrefslogtreecommitdiff
path: root/overlays/neomutt/tx.patch
blob: c8736dfbdc679d61ca7a239e71fb5fb0fd7ddaaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
commit 61ae454e1579d02736c48e3468a3237429214cdf
Author: Ismaël Bouya <ismael.bouya@normalesup.org>
Date:   Tue Jun 2 13:03:04 2020 +0200

    Add %tx to index_format

diff --git a/hdrline.c b/hdrline.c
index 9224c6641..1594ed729 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -575,6 +575,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
   const struct Address *from = TAILQ_FIRST(&e->env->from);
   const struct Address *to = TAILQ_FIRST(&e->env->to);
   const struct Address *cc = TAILQ_FIRST(&e->env->cc);
+  const struct Address *x_orig_to = TAILQ_FIRST(&e->env->x_original_to);
 
   buf[0] = '\0';
   switch (op)
@@ -1192,13 +1193,18 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
 
     case 't':
       tmp[0] = '\0';
-      if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
-          !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
-      {
-        if (to)
-          snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
-        else if (cc)
-          snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
+      if (src[0] == 'x') {
+        snprintf(tmp, sizeof(tmp), "%s", mutt_get_name(x_orig_to));
+        src++;
+      } else {
+        if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
+            !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
+        {
+          if (to)
+            snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
+          else if (cc)
+            snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
+        }
       }
       mutt_format_s(buf, buflen, prec, tmp);
       break;