summaryrefslogtreecommitdiff
path: root/alot/db
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-21 16:05:28 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-21 16:05:28 +0100
commited8b9267425d319c6449092bc537503d5e1f42a3 (patch)
treea294850971556ff88742c1dca784c49d09853dc1 /alot/db
parent5c4c77cac16e2a76b49734a68933764b105b06af (diff)
db/message: pass content-type to _render_part()
Do not get it from the underlying EmailMessage, since we may override it.
Diffstat (limited to 'alot/db')
-rw-r--r--alot/db/message.py5
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):