add --use-agent to GPG so that we work with gnupg-agent
This commit is contained in:
parent
a1349f9c3d
commit
8ede60ebb0
|
@ -43,8 +43,9 @@ else:
|
|||
USE_GPG = False
|
||||
|
||||
class GnuPG(GnuPGInterface.GnuPG):
|
||||
def __init__(self):
|
||||
def __init__(self, use_agent = False):
|
||||
GnuPGInterface.GnuPG.__init__(self)
|
||||
self.use_agent = use_agent
|
||||
self._setup_my_options()
|
||||
|
||||
def _setup_my_options(self):
|
||||
|
@ -53,6 +54,8 @@ else:
|
|||
self.options.extra_args.append('--no-secmem-warning')
|
||||
# Nolith's patch - prevent crashs on non fully-trusted keys
|
||||
self.options.extra_args.append('--always-trust')
|
||||
if self.use_agent:
|
||||
self.options.extra_args.append('--use-agent')
|
||||
|
||||
def _read_response(self, child_stdout):
|
||||
# Internal method: reads all the output from GPG, taking notice
|
||||
|
|
|
@ -84,7 +84,7 @@ class Connection(ConnectionHandlers):
|
|||
# Do we continue connection when we get roster (send presence,get vcard...)
|
||||
self.continue_connect_info = None
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG()
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||
gajim.config.set('usegpg', True)
|
||||
else:
|
||||
gajim.config.set('usegpg', False)
|
||||
|
@ -203,7 +203,7 @@ class Connection(ConnectionHandlers):
|
|||
return
|
||||
self.password = self.new_account_info['password']
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG()
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||
gajim.config.set('usegpg', True)
|
||||
else:
|
||||
gajim.config.set('usegpg', False)
|
||||
|
|
Loading…
Reference in New Issue