Skip to content
Snippets Groups Projects
Commit 447ec9ec authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

[gjc] ask password when gnomekeyring isn't available. fixes #2834

parent e816b38a
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,11 @@ class PasswordStorage(object):
class SimplePasswordStorage(PasswordStorage):
def get_password(self, account_name):
return gajim.config.get_per('accounts', account_name, 'password')
passwd = gajim.config.get_per('accounts', account_name, 'password')
if passwd.startswith('gnomekeyring:'):
return None # this is not a real password, it's a gnome keyring token
else:
return passwd
def save_password(self, account_name, password):
gajim.config.set_per('accounts', account_name, 'password', password)
......@@ -45,15 +49,15 @@ class SimplePasswordStorage(PasswordStorage):
class GnomePasswordStorage(PasswordStorage):
def __init__(self):
# self.keyring = gnomekeyring.get_default_keyring_sync()
## above line commented and code below inserted as workaround
## for the bug http://bugzilla.gnome.org/show_bug.cgi?id=363019
self.keyring = "default"
try:
gnomekeyring.create_sync(self.keyring, None)
except gnomekeyring.AlreadyExistsError:
def __init__(self):
# self.keyring = gnomekeyring.get_default_keyring_sync()
## above line commented and code below inserted as workaround
## for the bug http://bugzilla.gnome.org/show_bug.cgi?id=363019
self.keyring = "default"
try:
gnomekeyring.create_sync(self.keyring, None)
except gnomekeyring.AlreadyExistsError:
pass
def get_password(self, account_name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment