diff options
author | Kali Kaneko <kali@leap.se> | 2015-01-21 11:52:09 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-01-21 15:08:05 -0400 |
commit | 2e0fc3400fa55195b542a11e644f5be36b8ad659 (patch) | |
tree | d6bb0431d81ac15c295c8623159d32cba1854c1c /src/leap/mail/imap | |
parent | d327d8416475493864b1e0922b51812be566e028 (diff) |
rename confusing attribute for account
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r-- | src/leap/mail/imap/account.py | 11 | ||||
-rw-r--r-- | src/leap/mail/imap/server.py | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/leap/mail/imap/account.py b/src/leap/mail/imap/account.py index 146d066..0cf583b 100644 --- a/src/leap/mail/imap/account.py +++ b/src/leap/mail/imap/account.py @@ -61,7 +61,7 @@ class IMAPAccount(object): implements(imap4.IAccount, imap4.INamespacePresenter) selected = None - closed = False + session_ended = False def __init__(self, user_id, store, d=defer.Deferred()): """ @@ -92,6 +92,15 @@ class IMAPAccount(object): return None mbox = IMAPMailbox(collection, rw=readwrite) return mbox + def end_session(self): + """ + Used to mark when the session has closed, and we should not allow any + more commands from the client. + + Right now it's called from the client backend. + """ + # TODO move its use to the service shutdown in leap.mail + self.session_ended = True def callWhenReady(self, cb, *args, **kw): d = self.account.callWhenReady(cb, *args, **kw) diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py index f294f42..23ddefc 100644 --- a/src/leap/mail/imap/server.py +++ b/src/leap/mail/imap/server.py @@ -67,7 +67,7 @@ class LEAPIMAPServer(imap4.IMAP4Server): :param line: the line from the server, without the line delimiter. :type line: str """ - if self.theAccount.closed is True and self.state != "unauth": + if self.theAccount.session_ended is True and self.state != "unauth": log.msg("Closing the session. State: unauth") self.state = "unauth" |