From ea6e88d0e68309deba304c92d6cae5f31046e8b6 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 19 Jun 2015 22:21:47 +0200 Subject: [refactor] Use auth for fewer parameters --- service/pixelated/bitmask_libraries/session.py | 2 +- service/pixelated/bitmask_libraries/smtp.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'service/pixelated/bitmask_libraries') 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 -- cgit v1.2.3