summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/server.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-02-02 09:26:37 -0400
committerKali Kaneko <kali@leap.se>2014-02-02 18:08:31 -0400
commit18fed49c4143eb764ae9e806882d24f8f4e95744 (patch)
tree2c0c56a28ac9bf4839623b28de746670e6e4b499 /src/leap/mail/imap/server.py
parent3a8fda3aa4645adbba228e7d2f204bfe6d400321 (diff)
fix missing content after in-memory add
because THE KEYS WILL BE STRINGS AFTER ADDED TO SOLEDAD Can I remember that? * Fix copy from local folders * Fix copy when we already have a copy of the message in the inbox, marked as deleted. * Fix also bad deferred.succeed in add_msg when it already exist.
Diffstat (limited to 'src/leap/mail/imap/server.py')
-rw-r--r--src/leap/mail/imap/server.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py
index 7bca39d..ba63846 100644
--- a/src/leap/mail/imap/server.py
+++ b/src/leap/mail/imap/server.py
@@ -139,14 +139,22 @@ class LeapIMAPServer(imap4.IMAP4Server):
def on_fetch_finished(self, _, messages):
from twisted.internet import reactor
+
+ print "FETCH FINISHED -- NOTIFY NEW"
deferLater(reactor, 0, self.notifyNew)
deferLater(reactor, 0, self.mbox.unset_recent_flags, messages)
deferLater(reactor, 0, self.mbox.signal_unread_to_ui)
def on_copy_finished(self, defers):
d = defer.gatherResults(filter(None, defers))
- d.addCallback(self.notifyNew)
- d.addCallback(self.mbox.signal_unread_to_ui)
+
+ def when_finished(result):
+ log.msg("COPY FINISHED")
+ self.notifyNew()
+ self.mbox.signal_unread_to_ui()
+ d.addCallback(when_finished)
+ #d.addCallback(self.notifyNew)
+ #d.addCallback(self.mbox.signal_unread_to_ui)
def do_COPY(self, tag, messages, mailbox, uid=0):
from twisted.internet import reactor
@@ -162,6 +170,7 @@ class LeapIMAPServer(imap4.IMAP4Server):
"""
Notify new messages to listeners.
"""
+ print "TRYING TO NOTIFY NEW"
self.mbox.notify_new()
def _cbSelectWork(self, mbox, cmdName, tag):