Ticket #4369: gabble-pass.diff

File gabble-pass.diff, 1.2 KB (added by JerryV, 11 years ago)

patch to neighborhood.py

  • neighborhood.py

    old new  
    795795        for account_path in account_paths:
    796796            if 'gabble' in account_path:
    797797                logging.debug('Already have a Gabble account')
     798                self._jabber_server_password(account_path)
    798799                account = _Account(account_path)
    799                 account.enable()
    800800                return account
    801801
    802802        logging.debug('Still dont have a Gabble account, creating one')
     
    833833                                                     properties)
    834834        return _Account(account_path)
    835835
     836    def _jabber_server_password(self, account_path):
     837        logging.debug('jabber_server_password')
     838
     839        bus = dbus.Bus()
     840        account = bus.get_object(ACCOUNT_MANAGER_SERVICE,
     841                                 account_path)
     842
     843        key_hash = get_profile().privkey_hash
     844
     845        params_needing_reconnect = account.UpdateParameters(
     846            {'password': key_hash},
     847            dbus.Array([], 's'), dbus_interface=ACCOUNT)
     848
    836849    def _get_jabber_account_id(self):
    837850        public_key_hash = sha1(get_profile().pubkey).hexdigest()
    838851        client = GConf.Client.get_default()