summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/mail/imap/server.py')
-rw-r--r--src/leap/mail/imap/server.py28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py
index 7c09784..5da9bfd 100644
--- a/src/leap/mail/imap/server.py
+++ b/src/leap/mail/imap/server.py
@@ -20,9 +20,7 @@ Leap IMAP4 Server Implementation.
from copy import copy
from twisted import cred
-from twisted.internet import defer
from twisted.internet.defer import maybeDeferred
-from twisted.internet.task import deferLater
from twisted.mail import imap4
from twisted.python import log
@@ -135,35 +133,11 @@ class LeapIMAPServer(imap4.IMAP4Server):
).addCallback(
cbFetch, tag, query, uid
).addErrback(
- ebFetch, tag
- ).addCallback(
- self.on_fetch_finished, messages)
+ ebFetch, tag)
select_FETCH = (do_FETCH, imap4.IMAP4Server.arg_seqset,
imap4.IMAP4Server.arg_fetchatt)
- def on_fetch_finished(self, _, messages):
- deferLater(self.reactor, 0, self.notifyNew)
- deferLater(self.reactor, 0, self.mbox.unset_recent_flags, messages)
- deferLater(self.reactor, 0, self.mbox.signal_unread_to_ui)
-
- def on_copy_finished(self, defers):
- d = defer.gatherResults(filter(None, defers))
-
- def when_finished(result):
- self.notifyNew()
- self.mbox.signal_unread_to_ui()
- d.addCallback(when_finished)
-
- def do_COPY(self, tag, messages, mailbox, uid=0):
- defers = []
- d = imap4.IMAP4Server.do_COPY(self, tag, messages, mailbox, uid)
- defers.append(d)
- deferLater(self.reactor, 0, self.on_copy_finished, defers)
-
- select_COPY = (do_COPY, imap4.IMAP4Server.arg_seqset,
- imap4.IMAP4Server.arg_astring)
-
def notifyNew(self, ignored=None):
"""
Notify new messages to listeners.