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:
Dirk-Jan C. Binnema
2026-04-10 20:13:13 +03:00
committed by Seth Ladygo
parent 6715ff418a
commit f353e2dacf
5 changed files with 72 additions and 36 deletions

View File

@ -814,8 +814,7 @@ RU5EOlZFVkVOVA0KRU5EOlZDQUxFTkRBUg0K
g_assert_true(!!message);
assert_equal(message->subject(),
"Invitation: HELLO, @ Thu 9 Jan 2014 08:30 - 09:30 (william@example.com)");
g_assert_true(message->flags() == (Flags::Passed|Flags::Seen|
Flags::HasAttachment|Flags::Calendar));
g_assert_true(message->flags() == (Flags::Passed|Flags::Seen|Flags::Calendar));
g_assert_cmpuint(message->body_html().value_or("").find("DETAILS"), ==, 2271);
}