Commit f4094509 authored by Yann Leboulanger's avatar Yann Leboulanger

re-create gpg instance in at each connection son use_gpg_agent...

re-create gpg instance in at each connection son use_gpg_agent current value of use_gpg_agent option is used
warn user when he configured gajim to use gpg-agent but it returns a wrong passphrase. see #3592
parent 021e8fb2
......@@ -767,7 +767,7 @@ class Connection(ConnectionHandlers):
'hostname': socket.gethostname()
if USE_GPG and not self.gpg:
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
self.connect_and_init(show, msg, sign_msg)
......@@ -1371,13 +1371,16 @@ class Interface:
return False
def handle_event_bad_passphrase(self, account, array):
#('BAD_PASSPHRASE', account, ())
use_gpg_agent = gajim.config.get('use_gpg_agent')
sectext = ''
if use_gpg_agent:
sectext = _('You configured Gajim to use GPG agent, but there is no '
'GPG agent running or it returned a wrong passphrase.\n')
sectext += _('You are currently connected without your OpenPGP key.')
keyID = gajim.config.get_per('accounts', account, 'keyid')
dialogs.WarningDialog(_('Your passphrase is incorrect'),
_('You are currently connected without your OpenPGP key.'))
dialogs.WarningDialog(_('Your passphrase is incorrect'), sectext)
def handle_event_gpg_password_required(self, account, array):
#('GPG_PASSWORD_REQUIRED', account, (callback,))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment