From ed8b9267425d319c6449092bc537503d5e1f42a3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 21 Jan 2021 16:05:28 +0100 Subject: db/message: pass content-type to _render_part() Do not get it from the underlying EmailMessage, since we may override it. --- alot/db/message.py | 5 ++--- 1 file 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): -- cgit v1.2.3