diff --git a/frontends/src/quick_frontend/quick_app.py b/frontends/src/quick_frontend/quick_app.py index 3e36071d..de953ea0 100644 --- a/frontends/src/quick_frontend/quick_app.py +++ b/frontends/src/quick_frontend/quick_app.py @@ -543,7 +543,7 @@ class QuickApp(object): chat_widget = self.widgets.getWidget(quick_chat.QuickChat, room_jid, profile) if chat_widget: self.widgets.deleteWidget(chat_widget) - self.contact_lists[profile].remove(room_jid) + self.contact_lists[profile].removeContact(room_jid) def roomUserJoinedHandler(self, room_jid_s, user_nick, user_data, profile): """Called when an user joined a MUC room""" @@ -643,7 +643,7 @@ class QuickApp(object): def contactDeletedHandler(self, jid_s, profile): target = jid.JID(jid_s) - self.contact_lists[profile].remove(target) + self.contact_lists[profile].removeContact(target, in_roster=True) def entityDataUpdatedHandler(self, entity_s, key, value, profile): entity = jid.JID(entity_s) diff --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index feeedd0a..8fc9d41b 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -352,16 +352,19 @@ class QuickContactList(QuickWidget): """ return entity in self.getGroupData(group, "jids") - def remove(self, entity): + def removeContact(self, entity, in_roster=False): """remove a contact from the list @param entity(jid.JID): jid of the entity to remove (bare jid is used) + @param in_roster (bool): True if contact is from roster """ entity_bare = entity.bare try: groups = self._cache[entity_bare].get(C.CONTACT_GROUPS, set()) except KeyError: log.warning(_("Trying to delete an unknow entity [{}]").format(entity)) + if in_roster: + self._roster.remove(entity_bare) del self._cache[entity_bare] for group in groups: self._groups[group]['jids'].remove(entity_bare)