diff options
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r-- | src/leap/bitmask/core/dispatcher.py | 6 | ||||
-rw-r--r-- | src/leap/bitmask/core/mail_services.py | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py index f0c4e76..3e50b11 100644 --- a/src/leap/bitmask/core/dispatcher.py +++ b/src/leap/bitmask/core/dispatcher.py @@ -252,9 +252,11 @@ class MailCmd(SubCommand): @register_method('dict') def do_STATUS(self, mail, *parts, **kw): - userid = None - if len(parts) > 2: + try: userid = parts[2] + except IndexError: + raise DispatchError( + 'wrong number of arguments: expected 1, got none') d = mail.do_status(userid) return d diff --git a/src/leap/bitmask/core/mail_services.py b/src/leap/bitmask/core/mail_services.py index 4e67ac4..9271201 100644 --- a/src/leap/bitmask/core/mail_services.py +++ b/src/leap/bitmask/core/mail_services.py @@ -571,16 +571,16 @@ class StandardMailService(service.MultiService, HookableService): # commands @defer.inlineCallbacks - def do_status(self, userid=None): + def do_status(self, userid): smtp = self.getServiceNamed('smtp') imap = self.getServiceNamed('imap') + incoming = self.getServiceNamed('incoming_mail') + incoming_status = yield incoming.status(userid) childrenStatus = { 'smtp': smtp.status(), - 'imap': imap.status() + 'imap': imap.status(), + 'incoming': incoming_status } - if userid is not None: - incoming = self.getServiceNamed('incoming_mail') - childrenStatus['incoming'] = yield incoming.status(userid) def key(service): status = childrenStatus[service] |