message: improve attachment heuristics
Do not consider calender-invitations "attachments"; do mark as "calendar". Do recognize application/ics as calendar messages. Update mime-object to expose a message part's disposition. Change the "is-attachment" heuristic to include inline parts if they have a filename parameter in their content-disposition. Note that this doesn't change things radically; the delta is +69 and -202 for ~6500 attachments.
This commit is contained in:
@ -424,9 +424,11 @@ process_part(const MimeObject& parent, const MimePart& part,
|
||||
if (!ctype)
|
||||
return;
|
||||
|
||||
// flag as calendar, if not already
|
||||
// flag as calendar, if not already.
|
||||
if (none_of(info.flags & Flags::Calendar) &&
|
||||
ctype->is_type("text", "calendar"))
|
||||
(ctype->is_type("text", "calendar") ||
|
||||
ctype->is_type("text", "x-vcalendar") ||
|
||||
ctype->is_type("application", "ics")))
|
||||
info.flags |= Flags::Calendar;
|
||||
|
||||
// flag as attachment, if not already.
|
||||
|
||||
Reference in New Issue
Block a user