summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2015-05-11 18:04:29 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-05-14 12:41:48 -0300
commitd5d9c3794566b999bfd42398072c9f7e3177d1b9 (patch)
treee8035a20e5f888e53b221b5593ea484d441f4f10 /src/leap/mail/imap
parent154e1aa347bb9ee0a9ed9abd60ed703a81cce017 (diff)
[feat] adapt to new events api on common
- Related: #6359
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r--src/leap/mail/imap/server.py5
-rw-r--r--src/leap/mail/imap/service/imap.py8
2 files changed, 5 insertions, 8 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py
index 45da535..2b670c1 100644
--- a/src/leap/mail/imap/server.py
+++ b/src/leap/mail/imap/server.py
@@ -26,9 +26,8 @@ from twisted.internet.defer import maybeDeferred
from twisted.mail import imap4
from twisted.python import log
-from leap.common import events as leap_events
from leap.common.check import leap_assert, leap_assert_type
-from leap.common.events.events_pb2 import IMAP_CLIENT_LOGIN
+from leap.common.events import emit, catalog
from leap.soledad.client import Soledad
# imports for LITERAL+ patch
@@ -222,7 +221,7 @@ class LEAPIMAPServer(imap4.IMAP4Server):
# bad username, reject.
raise cred.error.UnauthorizedLogin()
# any dummy password is allowed so far. use realm instead!
- leap_events.signal(IMAP_CLIENT_LOGIN, "1")
+ emit(catalog.IMAP_CLIENT_LOGIN, "1")
return imap4.IAccount, self.theAccount, lambda: None
def do_FETCH(self, tag, messages, query, uid=0):
diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py
index b3282d4..370c513 100644
--- a/src/leap/mail/imap/service/imap.py
+++ b/src/leap/mail/imap/service/imap.py
@@ -31,14 +31,12 @@ from twisted.python import log
logger = logging.getLogger(__name__)
-from leap.common import events as leap_events
+from leap.common.events import emit, catalog
from leap.common.check import leap_assert_type, leap_check
from leap.mail.imap.account import IMAPAccount
from leap.mail.imap.server import LEAPIMAPServer
from leap.soledad.client import Soledad
-from leap.common.events.events_pb2 import IMAP_SERVICE_STARTED
-from leap.common.events.events_pb2 import IMAP_SERVICE_FAILED_TO_START
DO_MANHOLE = os.environ.get("LEAP_MAIL_MANHOLE", None)
if DO_MANHOLE:
@@ -182,10 +180,10 @@ def run_service(store, **kwargs):
reactor.listenTCP(manhole.MANHOLE_PORT, manhole_factory,
interface="127.0.0.1")
logger.debug("IMAP4 Server is RUNNING in port %s" % (port,))
- leap_events.signal(IMAP_SERVICE_STARTED, str(port))
+ emit(catalog.IMAP_SERVICE_STARTED, str(port))
# FIXME -- change service signature
return tport, factory
# not ok, signal error.
- leap_events.signal(IMAP_SERVICE_FAILED_TO_START, str(port))
+ emit(catalog.IMAP_SERVICE_FAILED_TO_START, str(port))