Author: steve-e Date: 2008-05-19 23:17:43 +0200 (Mon, 19 May 2008) New Revision: 9686
Modified: trunk/src/gajim.py trunk/src/roster_window.py Log: Always remove contacts from GUI when we receive a roster via xmppy.
This fixes a bug with metacontacts over different groups and should stop contact duplication in most cases.
Modified: trunk/src/gajim.py =================================================================== --- trunk/src/gajim.py 2008-05-19 20:25:58 UTC (rev 9685) +++ trunk/src/gajim.py 2008-05-19 21:17:43 UTC (rev 9686) @@ -652,6 +652,8 @@
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)
Modified: trunk/src/roster_window.py =================================================================== --- trunk/src/roster_window.py 2008-05-19 20:25:58 UTC (rev 9685) +++ trunk/src/roster_window.py 2008-05-19 21:17:43 UTC (rev 9686) @@ -1501,11 +1501,15 @@
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('/')