summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-01-21 11:52:09 -0400
committerKali Kaneko <kali@leap.se>2015-02-11 14:05:43 -0400
commitf223ad5dd81dbee83a7a3dd55a84eea125c35c04 (patch)
tree26435ed281f40bb2d8efda253b62933106165cf3
parenta65463ce46e4b3842ba06071a2df51b0f4054588 (diff)
rename confusing attribute for account
-rw-r--r--mail/src/leap/mail/imap/account.py11
-rw-r--r--mail/src/leap/mail/imap/server.py2
2 files changed, 11 insertions, 2 deletions
diff --git a/mail/src/leap/mail/imap/account.py b/mail/src/leap/mail/imap/account.py
index 146d0663..0cf583bd 100644
--- a/mail/src/leap/mail/imap/account.py
+++ b/mail/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/mail/src/leap/mail/imap/server.py b/mail/src/leap/mail/imap/server.py
index f294f42f..23ddefc3 100644
--- a/mail/src/leap/mail/imap/server.py
+++ b/mail/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"