diff --git a/src/common/connection.py b/src/common/connection.py index 5027b64ea..eca1b6483 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -30,6 +30,7 @@ import common.xmpp from common import helpers from common import gajim from common import GnuPG +from common import passwords from connection_handlers import * USE_GPG = GnuPG.USE_GPG @@ -60,7 +61,7 @@ class Connection(ConnectionHandlers): self.last_io = gajim.idlequeue.current_time() self.last_sent = [] self.last_history_line = {} - self.password = gajim.config.get_per('accounts', name, 'password') + self.password = passwords.get_password(name) self.server_resource = gajim.config.get_per('accounts', name, 'resource') if gajim.config.get_per('accounts', self.name, 'keep_alives_enabled'): self.keepalives = gajim.config.get_per('accounts', self.name,'keep_alive_every_foo_secs') diff --git a/src/config.py b/src/config.py index 50a6560ec..e76f76a18 100644 --- a/src/config.py +++ b/src/config.py @@ -37,6 +37,7 @@ except: from common import helpers from common import gajim from common import connection +from common import passwords #---------- PreferencesWindow class -------------# class PreferencesWindow: @@ -1454,9 +1455,9 @@ class AccountModificationWindow: for opt in config: gajim.config.set_per('accounts', name, opt, config[opt]) if config['savepass']: - gajim.connections[name].password = config['password'] + passwords.save_password(name, config['password']) else: - gajim.connections[name].password = None + passwords.save_password(name, None) # refresh accounts window if gajim.interface.instances.has_key('accounts'): gajim.interface.instances['accounts'].init_accounts() diff --git a/src/roster_window.py b/src/roster_window.py index 86566501a..07973c545 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -35,6 +35,7 @@ import notify from common import gajim from common import helpers +from common import passwords from message_window import MessageWindowMgr from chat_control import ChatControl from groupchat_control import GroupchatControl @@ -2206,8 +2207,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid) gajim.connections[account].password = passphrase if save: gajim.config.set_per('accounts', account, 'savepass', True) - gajim.config.set_per('accounts', account, 'password', - passphrase) + passwords.save_password(account, passphrase) keyid = None use_gpg_agent = gajim.config.get('use_gpg_agent')