diff --git a/src/gajim.py b/src/gajim.py index a7203d445..615becc46 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -652,6 +652,8 @@ class Interface: def handle_event_roster(self, account, data): #('ROSTER', account, array) + # FIXME: Those methods depend to highly on each other + # and the order in which they are called self.roster.fill_contacts_and_groups_dicts(data, account) self.roster.add_account_contacts(account) self.roster.fire_up_unread_messages_events(account) diff --git a/src/roster_window.py b/src/roster_window.py index df6d0c696..c645c1ca4 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1501,11 +1501,15 @@ class RosterWindow: def fill_contacts_and_groups_dicts(self, array, account): '''fill gajim.contacts and gajim.groups''' + # FIXME: This function needs to be splitted + # Most of the logic SHOULD NOT be done at GUI level if account not in gajim.contacts.get_accounts(): gajim.contacts.add_account(account) if not gajim.groups.has_key(account): gajim.groups[account] = {} for jid in array.keys(): + # Remove the contact in roster. It might has changed + self.remove_contact(jid, account) # Remove old Contact instances gajim.contacts.remove_jid(account, jid, remove_meta=False) jids = jid.split('/')