fix changing account name. Fixes #5891

This commit is contained in:
Yann Leboulanger 2010-09-08 22:26:04 +02:00
parent da524c94fd
commit 35039100ff
3 changed files with 8 additions and 0 deletions

View File

@ -502,6 +502,9 @@ class ConnectionPEP(object):
self._pubsub_connection = pubsub_connection
self.reset_awaiting_pep()
def pep_change_account_name(self, new_name):
self._account = new_name
def reset_awaiting_pep(self):
self.to_be_sent_activity = None
self.to_be_sent_mood = None

View File

@ -38,6 +38,9 @@ class ConnectionCaps(object):
self._capscache = capscache
self._create_suitable_client_caps = client_caps_factory
def caps_change_account_name(self, new_name):
self._account = new_name
def _capsPresenceCB(self, con, presence):
"""
XMMPPY callback method to handle retrieved caps info

View File

@ -2055,6 +2055,8 @@ class AccountsWindow:
del gajim.gajim_optional_features[old_name]
del gajim.caps_hash[old_name]
gajim.connections[old_name].name = new_name
gajim.connections[old_name].pep_change_account_name(new_name)
gajim.connections[old_name].caps_change_account_name(new_name)
gajim.connections[new_name] = gajim.connections[old_name]
del gajim.connections[old_name]
gajim.config.add_per('accounts', new_name)