diff options
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r-- | src/leap/mail/imap/server.py | 5 | ||||
-rw-r--r-- | src/leap/mail/imap/service/imap.py | 8 |
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)) |