diff frontends/src/quick_frontend/quick_contact_list.py @ 1397:96dd0ae1a850

quick_frontend (contact_list): rename QuickContactList.remove to QuickContactList.removeContact + remove the contact from _roster attribute (and not only from _cache)
author souliane <souliane@mailoo.org>
date Wed, 01 Apr 2015 22:07:28 +0200
parents 069ad98b360d
children 5c3d1d970b94
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_contact_list.py	Mon Mar 30 10:26:26 2015 +0200
+++ b/frontends/src/quick_frontend/quick_contact_list.py	Wed Apr 01 22:07:28 2015 +0200
@@ -352,16 +352,19 @@
         """
         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)