summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorkaeff <hi@kaeff.net>2015-08-17 15:56:50 +0200
committerkaeff <hi@kaeff.net>2015-08-17 15:56:50 +0200
commitb16bae353e40fa05b4993ef68232a9df83db370e (patch)
tree0768a89a5b98e26b31b52e59aa21fc4a358af8ba /service
parent57376b6cb20b0d4af0e5940f29229421adf8679f (diff)
Read encoding from attachment info instead of headers
Clean up by removing now unused headers from attachment info, and add a unit test for attachment rendering
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/adapter/mailstore/leap_mailstore.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py
index a8fa6d13..a9fb5ba1 100644
--- a/service/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/pixelated/adapter/mailstore/leap_mailstore.py
@@ -26,11 +26,10 @@ from pixelated.adapter.model.mail import Mail, InputMail
class AttachmentInfo(object):
- def __init__(self, ident, name, encoding, headers):
+ def __init__(self, ident, name, encoding):
self.ident = ident
self.name = name
self.encoding = encoding
- self.headers = headers
class LeapMail(Mail):
@@ -99,7 +98,7 @@ class LeapMail(Mail):
'textPlainBody': self._body,
'replying': self._replying_dict(),
'mailbox': self._mailbox_name.lower(),
- 'attachments': [{'ident': attachment.ident, 'name': attachment.name, 'encoding': attachment.encoding, 'headers': attachment.headers} for attachment in self._attachments]
+ 'attachments': [{'ident': attachment.ident, 'name': attachment.name, 'encoding': attachment.encoding} for attachment in self._attachments]
}
def _replying_dict(self):
@@ -311,7 +310,7 @@ class LeapMailStore(MailStore):
if 'attachment' in disposition:
filename = _extract_filename(disposition)
encoding = headers['Content-Transfer-Encoding']
- result.append(AttachmentInfo(phash, filename, encoding, headers))
+ result.append(AttachmentInfo(phash, filename, encoding))
return result