summaryrefslogtreecommitdiff
path: root/src/leap/mail/adaptors
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-06-25 10:45:46 -0400
committerKali Kaneko <kali@leap.se>2015-06-25 16:44:45 -0400
commitcc487c6bc77769079fc4cdc23b6ad2bdd7c22394 (patch)
tree3bef827ac8063874ec6678c53802ea1eb2ffeb02 /src/leap/mail/adaptors
parent9db1529e60cadff872cd3066e837e15413216b71 (diff)
[bug] avoid duplication of copies in draft folder
Although this draft-saving feature seems to be somehow brittle, since it breaks from time to time, the causes are different and subtle on each case. This time the bug is related to having the notify_just_mdoc (or fast_notifies as I'm tempted to call it in the future for more clarity) set to True by default in the APPENDS. Fast notifies break the "save draft" functionality because what Thunderbird does is an Append of the newest message, followed by deletion of the old message and a SEARCH by Message-ID. For this we need the headers-doc to be already inserted in the store. Since the fast-notify makes a *big* difference in terms of insertion times for serialized appends, I've opted for using a heuristic for detecting if it's the case of a Draft message, using a mozilla-specific header. If this is found, we set the notify_just_mdoc unconditionally to False. We'll deal with other MUAs on its due time. Releases: 0.4.0
Diffstat (limited to 'src/leap/mail/adaptors')
-rw-r--r--src/leap/mail/adaptors/soledad.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leap/mail/adaptors/soledad.py b/src/leap/mail/adaptors/soledad.py
index 7e41f94..0565877 100644
--- a/src/leap/mail/adaptors/soledad.py
+++ b/src/leap/mail/adaptors/soledad.py
@@ -547,8 +547,7 @@ class MessageWrapper(object):
"Cannot create: fdoc has a doc_id")
def unblock_pending_insert(result):
- h = self.hdoc.headers
- ci_headers = dict([(k.lower(), v) for (k, v) in h.items()])
+ ci_headers = lowerdict(self.hdoc.headers)
msgid = ci_headers.get('message-id', None)
try:
d = pending_inserts_dict[msgid]
@@ -1101,6 +1100,7 @@ class SoledadMailAdaptor(SoledadIndexMixin):
def get_mdoc_id(hdoc):
if not hdoc:
+ log.msg("Could not find a HDOC with MSGID %s" % msgid)
return None
hdoc = hdoc[0]
mdoc_id = hdoc.doc_id.replace("H-", "M-%s-" % uuid)