diff options
| author | tv <tv@krebsco.de> | 2026-04-02 05:13:31 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-04-02 05:13:31 +0200 |
| commit | fd4c3dc8a0114f529dc6d6f53f9175c9c646205c (patch) | |
| tree | 9501db707dc5c253c1748c221ec223fdcc34eea9 /src/Notmuch | |
| parent | 74a1f3986dcd5e87a11a4108297a36954d179a62 (diff) | |
explicitly load primary message part
Previously the primary part was loaded only for text/plain,
because notmuch show included it automatically.
Now any MIME type can be loaded.
Diffstat (limited to 'src/Notmuch')
| -rw-r--r-- | src/Notmuch/Message.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Notmuch/Message.hs b/src/Notmuch/Message.hs index 13f3413..93ed07f 100644 --- a/src/Notmuch/Message.hs +++ b/src/Notmuch/Message.hs @@ -46,6 +46,13 @@ contentSize (ContentMsgRFC822 xs) = sum $ map (sum . map (contentSize . partCont contentSize (ContentRaw _ contentLength) = contentLength +primaryMessagePart :: MessagePart -> MessagePart +primaryMessagePart mp = + case partContent mp of + ContentMultipart (mp':_) -> primaryMessagePart mp' + _ -> mp + + parseRFC822 :: V.Vector Value -> Parser MessageContent parseRFC822 lst = ContentMsgRFC822 . V.toList <$> V.mapM p lst where |
