summaryrefslogtreecommitdiff
path: root/alot/db/message.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-30 16:33:56 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-30 16:33:56 +0100
commit309fb25e9b089618c37f1a741fa6009cce54ac9e (patch)
tree2e9b65c7511a2bb6b726ab70a9e488dad74beef9 /alot/db/message.py
parentcd35ec5f89cff3ba8c7780209efa7e8b0628744d (diff)
db/attachment: simplify the Attachment class
Make it a plain container around raw data and a few bits of metadata, rather than around a whole MIME part.
Diffstat (limited to 'alot/db/message.py')
-rw-r--r--alot/db/message.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/db/message.py b/alot/db/message.py
index 8ca8f2b3..5db42c0a 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -121,7 +121,9 @@ class _MimeTree:
cd = part.get_content_disposition()
fn = part.get_filename()
if cd == 'attachment' or fn is not None:
- self.attachment = Attachment(part)
+ data = part.get_content()
+ self.attachment = Attachment(data, self.content_type,
+ fn, part.get_params())
def __str__(self):
return 'MimePart(%s)' % self.content_type