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;