diff --git a/src/common/contacts.py b/src/common/contacts.py index 52cb81959..91588de76 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -202,6 +202,9 @@ class Contacts: if len(self._contacts[account][contact.jid]) == 0: del self._contacts[account][contact.jid] + def clear_contacts(self, account): + self._contacts[account] = {} + def remove_jid(self, account, jid): '''Removes all contacts for a given jid''' if not self._contacts.has_key(account): diff --git a/src/roster_window.py b/src/roster_window.py index 08d45eda5..3bb928226 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1223,6 +1223,8 @@ class RosterWindow: gajim.contacts.add_account(account) if not gajim.groups.has_key(account): gajim.groups[account] = {} + # Empty contact list + gajim.contacts.clear_contacts(account) for jid in array.keys(): jids = jid.split('/') #get jid