gpg password is now saved 30 seconds when we enter it, so if it is used in several accounts, we don't need to enter the password twice.
This commit is contained in:
parent
59029d7c05
commit
c5866f3a3f
|
@ -786,6 +786,11 @@ class Roster_window:
|
|||
self.remove_user(u, account)
|
||||
del self.contacts[account][u.jid]
|
||||
|
||||
def forget_gpg_passphrase(self, keyid):
|
||||
if self.gpg_passphrase.has_key(keyid):
|
||||
del self.gpg_passphrase[keyid]
|
||||
return False
|
||||
|
||||
def send_status(self, account, status, txt):
|
||||
if status != 'offline':
|
||||
if gajim.connections[account].connected < 2:
|
||||
|
@ -826,13 +831,19 @@ class Roster_window:
|
|||
passphrase = gajim.config.get_per('accounts', account,
|
||||
'gpgpassword')
|
||||
else:
|
||||
passphrase = ''
|
||||
if self.gpg_passphrase.has_key(keyid):
|
||||
passphrase = self.gpg_passphrase[keyid]
|
||||
save = False
|
||||
else:
|
||||
w = dialogs.Passphrase_dialog(
|
||||
_('Enter GPG key passphrase for account %s') % account,
|
||||
'Save passphrase')
|
||||
passphrase, save = w.run()
|
||||
if passphrase == -1:
|
||||
passphrase = ''
|
||||
else:
|
||||
self.gpg_passphrase[keyid] = passphrase
|
||||
gobject.timeout_add(30000, self.forget_gpg_passphrase, keyid)
|
||||
if save:
|
||||
gajim.config.set_per('accounts', account, 'savegpgpass', True)
|
||||
gajim.config.set_per('accounts', account, 'gpgpassword',
|
||||
|
@ -1508,6 +1519,7 @@ class Roster_window:
|
|||
self.to_be_removed = {}
|
||||
self.popups_notification_height = 0
|
||||
self.popup_notification_windows = []
|
||||
self.gpg_passphrase = {}
|
||||
for a in gajim.connections:
|
||||
self.contacts[a] = {}
|
||||
self.groups[a] = {}
|
||||
|
|
Loading…
Reference in New Issue