summaryrefslogtreecommitdiffstats
path: root/hdrline.c
diff options
context:
space:
mode:
authorDavid Champion <dgc@bikeshed.us>2005-10-04 06:05:39 +0000
committerDavid Champion <dgc@bikeshed.us>2005-10-04 06:05:39 +0000
commitf5e7b39153b414d2f9c2f9e369f41f895d253f40 (patch)
tree3a5758e9515a3868385eeb593f89adbcd739186c /hdrline.c
parent324752c8dbb1e28777518f1a01e3d4b9baf46aad (diff)
Attachment counting for index display (patch-1.5.11.dgc.attach.6).
Modifications: attach_recurse and attach_ignore_fundamental stripped, some debugging code removed, some bones thrown to check_sec.sh.
Diffstat (limited to 'hdrline.c')
-rw-r--r--hdrline.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hdrline.c b/hdrline.c
index a938c81d..3a40747a 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -218,6 +218,7 @@ int mutt_user_is_recipient (HEADER *h)
* %T = $to_chars
* %u = user (login) name of author
* %v = first name of author, unless from self
+ * %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 */
@@ -654,6 +655,28 @@ hdr_format_str (char *dest,
mutt_format_s (dest, destlen, prefix, buf2);
break;
+ case 'X':
+ {
+ int count, flags;
+
+ if (hdr->content->parts)
+ count = mutt_count_body_parts(hdr, flags);
+ else
+ {
+ mutt_parse_mime_message(ctx, hdr);
+ count = mutt_count_body_parts(hdr, flags);
+ mutt_free_body(&hdr->content->parts);
+ }
+
+ /* The recursion allows messages without depth to return 0. */
+ if (optional)
+ optional = count != 0;
+
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (dest, destlen, fmt, count);
+ }
+ break;
+
case 'y':
if (optional)
optional = hdr->env->x_label ? 1 : 0;