summaryrefslogtreecommitdiff
path: root/service/pixelated/bitmask_libraries
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-06-19 22:21:47 +0200
committerVictor Shyba <victor.shyba@gmail.com>2015-06-19 22:21:47 +0200
commitea6e88d0e68309deba304c92d6cae5f31046e8b6 (patch)
tree03f0a4e082976a04ee8999573378da3a2b15834b /service/pixelated/bitmask_libraries
parent89c9a1e1836098e2e55a225943d29e6d6474c240 (diff)
[refactor] Use auth for fewer parameters
Diffstat (limited to 'service/pixelated/bitmask_libraries')
-rw-r--r--service/pixelated/bitmask_libraries/session.py2
-rw-r--r--service/pixelated/bitmask_libraries/smtp.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/service/pixelated/bitmask_libraries/session.py b/service/pixelated/bitmask_libraries/session.py
index a7da7614..a9cb15f2 100644
--- a/service/pixelated/bitmask_libraries/session.py
+++ b/service/pixelated/bitmask_libraries/session.py
@@ -122,7 +122,7 @@ class LeapSessionFactory(object):
account = self._create_account(auth.uuid, soledad)
incoming_mail_fetcher = self._create_incoming_mail_fetcher(nicknym, soledad, account, account_email)
- smtp = LeapSmtp(self._provider, auth.username, auth.session_id, auth.token, nicknym.keymanager)
+ smtp = LeapSmtp(self._provider, auth, nicknym.keymanager)
return LeapSession(self._provider, auth, soledad, nicknym, account, incoming_mail_fetcher, smtp)
diff --git a/service/pixelated/bitmask_libraries/smtp.py b/service/pixelated/bitmask_libraries/smtp.py
index 3e2d1b21..31e56995 100644
--- a/service/pixelated/bitmask_libraries/smtp.py
+++ b/service/pixelated/bitmask_libraries/smtp.py
@@ -26,12 +26,12 @@ logger = logging.getLogger(__name__)
class LeapSmtp(object):
- def __init__(self, provider, username, session_id, user_token, keymanager=None):
+ def __init__(self, provider, auth, keymanager=None):
self.local_smtp_port_number = random.randrange(12000, 16000)
self._provider = provider
- self.username = username
- self.session_id = session_id
- self.user_token = user_token
+ self.username = auth.username
+ self.session_id = auth.session_id
+ self.user_token = auth.token
self._keymanager = keymanager
self._remote_hostname, self._remote_port = self._discover_remote_smtp_server()
self._local_smtp_service_socket = None