From 3340e1a898bacdd05fb6e6bf8d37596f7aff81a2 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 7 Apr 2016 09:56:36 -0400 Subject: [feat] use same token for imap/smtp authentication This greatly simplifies the handling of the password in the thunderbird extension. - Related: #6041 --- src/leap/bitmask/backend/components.py | 7 ++----- src/leap/bitmask/gui/mainwindow.py | 14 ++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/leap/bitmask/backend/components.py b/src/leap/bitmask/backend/components.py index 0c2b3280..f9ad1480 100644 --- a/src/leap/bitmask/backend/components.py +++ b/src/leap/bitmask/backend/components.py @@ -806,11 +806,8 @@ class Soledad(object): (service, token)) sol = self._soledad_bootstrapper.soledad - d = sol.get_or_create_service_token('imap') - d.addCallback(register_service_token, 'imap') - d.addCallback( - lambda _: sol.get_or_create_service_token('smtp')) - d.addCallback(register_service_token, 'smtp') + d = sol.get_or_create_service_token('mail_auth') + d.addCallback(register_service_token, 'mail_auth') d.addCallback(lambda _: result) return d diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 839aae87..ace3f863 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1089,12 +1089,11 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # FIXME on i3, this doens't allow to mouse-select. # Switch to a dialog in which we can set the QLabel - imap_token = (self._service_tokens.get('imap', None) or - "??? (log in to unlock)") - smtp_token = (self._service_tokens.get('smtp', None) or - "??? (log in to unlock)") - imap_password = self.tr("IMAP Password:") + " %s" % (imap_token,) - smtp_password = self.tr("SMTP Password:") + " %s" % (smtp_token,) + mail_auth_token = ( + self._service_tokens.get('mail_auth', None) or + "??? (log in to unlock)") + mail_password = self.tr("IMAP/SMTP Password:") + " %s" % ( + mail_auth_token,) msg = help_url + self.tr( "

{0}

" @@ -1105,10 +1104,9 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): "
  •  {4}
  • " "
  •  {5}
  • " "
  •  {6}
  • " - "
  •  {7}
  • " "

    ").format(email_quick_reference, thunderbird_text, manual_text, manual_imap, manual_smtp, - manual_username, imap_password, smtp_password) + manual_username, mail_password) QtGui.QMessageBox.about(self, self.tr("Bitmask Help"), msg) def _needs_update(self): -- cgit v1.2.3