* %X = number of MIME attachments
* %y = `x-label:' field (if present)
* %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label)
- * %Z = status flags */
+ * %zs = message status flags
+ * %zc = message crypto flags
+ * %zt = message tag flags
+ * %Z = combined message flags
+ */
static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int cols,
char op, const char *src, const char *prefix,
const char *ifstring, const char *elsestring,
break;
#endif
+ case 'z':
+ if (src[0] == 's') /* status: deleted/new/old/replied */
+ {
+ char *ch;
+ if (hdr->deleted)
+ ch = get_nth_wchar(Flagchars, FlagCharDeleted);
+ else if (hdr->attach_del)
+ ch = get_nth_wchar(Flagchars, FlagCharDeletedAttach);
+ else if (THREAD_NEW)
+ ch = get_nth_wchar(Flagchars, FlagCharNewThread);
+ else if (THREAD_OLD)
+ ch = get_nth_wchar(Flagchars, FlagCharOldThread);
+ else if (hdr->read && (ctx && (ctx->msgnotreadyet != hdr->msgno)))
+ {
+ if (hdr->replied)
+ ch = get_nth_wchar(Flagchars, FlagCharReplied);
+ else
+ ch = get_nth_wchar(Flagchars, FlagCharZEmpty);
+ }
+ else
+ {
+ if (hdr->old)
+ ch = get_nth_wchar(Flagchars, FlagCharOld);
+ else
+ ch = get_nth_wchar(Flagchars, FlagCharNew);
+ }
+
+ snprintf(buf2, sizeof(buf2), "%s", ch);
+ src++;
+ }
+ else if (src[0] == 'c') /* crypto */
+ {
+ char *ch;
+ if (WithCrypto && (hdr->security & GOODSIGN))
+ ch = "S";
+ else if (WithCrypto && (hdr->security & ENCRYPT))
+ ch = "P";
+ else if (WithCrypto && (hdr->security & SIGN))
+ ch = "s";
+ else if ((WithCrypto & APPLICATION_PGP) && (hdr->security & PGPKEY))
+ ch = "K";
+ else
+ ch = " ";
+
+ snprintf(buf2, sizeof(buf2), "%s", ch);
+ src++;
+ }
+ else if (src[0] == 't') /* tagged, flagged, recipient */
+ {
+ char *ch;
+ if (hdr->tagged)
+ ch = get_nth_wchar(Flagchars, FlagCharTagged);
+ else if (hdr->flagged)
+ ch = get_nth_wchar(Flagchars, FlagCharImportant);
+ else
+ ch = get_nth_wchar(Tochars, user_is_recipient(hdr));
+
+ snprintf(buf2, sizeof(buf2), "%s", ch);
+ src++;
+ }
+ else /* fallthrough */
+ break;
+
+ colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_FLAGS);
+ mutt_format_s(dest + colorlen, destlen - colorlen, prefix, buf2);
+ add_index_color(dest + colorlen, destlen - colorlen, flags, MT_COLOR_INDEX);
+ break;
+
case 'Z':
{
/* New/Old for threads; replied; New/Old for messages */
** .dt %Y .dd ``X-Label:'' field, if present, and \fI(1)\fP not at part of a thread tree,
** \fI(2)\fP at the top of a thread, or \fI(3)\fP ``X-Label:'' is different from
** preceding message's ``X-Label:''.
- ** .dt %Z .dd message status flags
+ ** .dt %Z .dd Combined message flags
+ ** .dt %zs .dd message status flags
+ ** .dt %zc .dd message crypto flags
+ ** .dt %zt .dd message tag flags
** .dt %{fmt} .dd the date and time of the message is converted to sender's
** time zone, and ``fmt'' is expanded by the library function
** \fCstrftime(3)\fP; a leading bang disables locales