From bf9db4b5381230b4e2a1e1d2d4b2acc31c29ff87 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 5 Feb 2014 16:47:36 -0400 Subject: Fix the fallback for the memoized call for bodies/content. Changed to "empty" to consider empty strings too. --- src/leap/mail/imap/memorystore.py | 9 +++++---- src/leap/mail/imap/messageparts.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/leap/mail') diff --git a/src/leap/mail/imap/memorystore.py b/src/leap/mail/imap/memorystore.py index f4a4522..9c7973d 100644 --- a/src/leap/mail/imap/memorystore.py +++ b/src/leap/mail/imap/memorystore.py @@ -230,10 +230,11 @@ class MemoryStore(object): self._add_message(mbox, uid, message, notify_on_disk) self._new.add(key) - def log_add(result): - log.msg("message save: %s" % result) - return result - observer.addCallback(log_add) + # XXX use this while debugging the callback firing, + # remove after unittesting this. + #def log_add(result): + #return result + #observer.addCallback(log_add) if notify_on_disk: # We store this deferred so we can keep track of the pending diff --git a/src/leap/mail/imap/messageparts.py b/src/leap/mail/imap/messageparts.py index 2d9b3a2..b1f333a 100644 --- a/src/leap/mail/imap/messageparts.py +++ b/src/leap/mail/imap/messageparts.py @@ -398,7 +398,7 @@ class MessagePart(object): payload = "" else: payload = self._get_payload_from_document_memoized(phash) - if payload is None: + if empty(payload): payload = self._get_payload_from_document(phash) else: -- cgit v1.2.3