mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add ~M pattern to match mime Content-Types.

authored by

Ammon Riley and committed by
Kevin McCarthy
974235c7 c9f5498c

+33
+1
doc/manual.xml.head
··· 5203 5203 <row><entry>%L <emphasis>GROUP</emphasis></entry><entry>message either originated or received by any member of <emphasis>GROUP</emphasis></entry></row> 5204 5204 <row><entry>~l</entry><entry>messages addressed to a known mailing list</entry></row> 5205 5205 <row><entry>~m [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *)</entry></row> 5206 + <row><entry>~M <emphasis>EXPR</emphasis></entry><entry>messages which contain a mime Content-Type matching <emphasis>EXPR</emphasis></entry></row> 5206 5207 <row><entry>~n [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages with a score in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *)</entry></row> 5207 5208 <row><entry>~N</entry><entry>new messages</entry></row> 5208 5209 <row><entry>~O</entry><entry>old messages</entry></row>
+3
doc/muttrc.man.head
··· 575 575 ~m \fIMIN\fP-\fIMAX\fP 576 576 message in the range \fIMIN\fP to \fIMAX\fP 577 577 .TP 578 + ~M \fIEXPR\fP 579 + messages which contain a mime Content-Type matching \fIEXPR\fP 580 + .TP 578 581 ~n \fIMIN\fP-\fIMAX\fP 579 582 messages with a score in the range \fIMIN\fP to \fIMAX\fP 580 583 .TP
+1
mutt.h
··· 253 253 MUTT_PGP_KEY, 254 254 MUTT_XLABEL, 255 255 MUTT_MIMEATTACH, 256 + MUTT_MIMETYPE, 256 257 257 258 /* Options for Mailcap lookup */ 258 259 MUTT_EDIT,
+28
pattern.c
··· 25 25 #include "keymap.h" 26 26 #include "mailbox.h" 27 27 #include "copy.h" 28 + #include "mime.h" 28 29 29 30 #include <string.h> 30 31 #include <stdlib.h> ··· 76 77 { 'l', MUTT_LIST, 0, NULL }, 77 78 { 'L', MUTT_ADDRESS, 0, eat_regexp }, 78 79 { 'm', MUTT_MESSAGE, 0, eat_range }, 80 + { 'M', MUTT_MIMETYPE, MUTT_FULL_MSG, eat_regexp }, 79 81 { 'n', MUTT_SCORE, 0, eat_range }, 80 82 { 'N', MUTT_NEW, 0, NULL }, 81 83 { 'O', MUTT_OLD, 0, NULL }, ··· 1138 1140 return 0; 1139 1141 } 1140 1142 1143 + static int match_content_type(const pattern_t* pat, BODY *b) 1144 + { 1145 + char buffer[STRING]; 1146 + if (!b) 1147 + return 0; 1148 + 1149 + snprintf (buffer, STRING, "%s/%s", TYPE (b), b->subtype); 1150 + 1151 + if (patmatch (pat, buffer) == 0) 1152 + return 1; 1153 + if (match_content_type (pat, b->parts)) 1154 + return 1; 1155 + if (match_content_type (pat, b->next)) 1156 + return 1; 1157 + return 0; 1158 + } 1159 + 1160 + static int match_mime_content_type(const pattern_t *pat, CONTEXT *ctx, HEADER *hdr) 1161 + { 1162 + mutt_parse_mime_message(ctx, hdr); 1163 + return match_content_type(pat, hdr->content); 1164 + } 1141 1165 1142 1166 /* Sets a value in the pattern_cache_t cache entry. 1143 1167 * Normalizes the "true" value to 2. */ ··· 1338 1362 return (pat->not ^ (count >= pat->min && (pat->max == MUTT_MAXRANGE || 1339 1363 count <= pat->max))); 1340 1364 } 1365 + case MUTT_MIMETYPE: 1366 + if (!ctx) 1367 + return 0; 1368 + return (pat->not ^ match_mime_content_type (pat, ctx, h)); 1341 1369 case MUTT_UNREFERENCED: 1342 1370 return (pat->not ^ (h->thread && !h->thread->child)); 1343 1371 }