diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-01-21 16:05:28 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-01-21 16:05:28 +0100 |
commit | ed8b9267425d319c6449092bc537503d5e1f42a3 (patch) | |
tree | a294850971556ff88742c1dca784c49d09853dc1 | |
parent | 5c4c77cac16e2a76b49734a68933764b105b06af (diff) |
db/message: pass content-type to _render_part()
Do not get it from the underlying EmailMessage, since we may override
it.
-rw-r--r-- | alot/db/message.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/alot/db/message.py b/alot/db/message.py index bc2125c6..0430025c 100644 --- a/alot/db/message.py +++ b/alot/db/message.py @@ -25,13 +25,12 @@ _APP_PGP_SIG = 'application/pgp-signature' _APP_PGP_ENC = 'application/pgp-encrypted' _TEXT_PLAIN = 'text/plain' -def _render_part(part, field_key='copiousoutput'): +def _render_part(part, ctype, field_key='copiousoutput'): """ renders a non-multipart email part into displayable plaintext by piping its payload through an external script. The handler itself is determined by the mailcap entry for this part's ctype. """ - ctype = part.get_content_type() raw_payload = part.get_content() rendered_payload = None @@ -183,7 +182,7 @@ class _MimeTree: if self.content_type == _TEXT_PLAIN: return content - return _render_part(self._part) + return _render_part(self._part, self.content_type) @property def raw_data(self): |