summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-01-29 16:43:15 -0400
committerKali Kaneko <kali@leap.se>2014-01-30 14:56:10 -0400
commit5818a2e6826d84cd82cc578fbce95aa549d70e25 (patch)
tree3c757744d14679f66f66cf1e36a6f2f5819f450b
parentbd06be63eac85a29e32768e55ab52a46043f3493 (diff)
Fix indexing error that was rendering attachments unusable
Also, check for empty body-doc
-rw-r--r--src/leap/mail/imap/messages.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py
index 5770868..2ace103 100644
--- a/src/leap/mail/imap/messages.py
+++ b/src/leap/mail/imap/messages.py
@@ -301,7 +301,7 @@ class LeapMessage(fields, MailParser, MBoxParser):
fd = StringIO.StringIO()
if self._bdoc is not None:
bdoc_content = self._bdoc.content
- if bdoc_content is None:
+ if empty(bdoc_content):
logger.warning("No BDOC content found for message!!!")
return write_fd("")
@@ -906,9 +906,10 @@ class MessageCollection(WithMsgFields, IndexedDB, MailParser, MBoxParser):
hd[key] = parts_map[key]
del parts_map
- # The MessageContainer expects a dict, zero-indexed
+ # The MessageContainer expects a dict, one-indexed
# XXX review-me
- cdocs = dict(enumerate(walk.get_raw_docs(msg, parts)))
+ cdocs = dict(((key + 1, doc) for key, doc in
+ enumerate(walk.get_raw_docs(msg, parts))))
self.set_recent_flag(uid)
@@ -960,7 +961,6 @@ class MessageCollection(WithMsgFields, IndexedDB, MailParser, MBoxParser):
fields.RECENTFLAGS_KEY, []))
return self.__rflags
- @profile
def _set_recent_flags(self, value):
"""
Setter for the recent-flags set for this mailbox.