From f0f097c10626fc31ec30f4561c204c0bf0fc2263 Mon Sep 17 00:00:00 2001 From: souliane Date: Fri, 6 Feb 2015 19:31:13 +0100 Subject: [PATCH] quick_frontend: remove the contact from the groups it has been removed from --- frontends/src/quick_frontend/quick_contact_list.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index 594d0284..82009c3d 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -236,6 +236,10 @@ class QuickContactList(QuickWidget): if groups is not None: if not groups: groups = [None] # [None] is the default group + if C.CONTACT_GROUPS in cache: + # XXX: don't use set(cache[C.CONTACT_GROUPS]).difference(groups) because it won't work in Pyjamas if None is in cache[C.CONTACT_GROUPS] + for group in [group for group in cache[C.CONTACT_GROUPS] if group not in groups]: + self._groups[group]['jids'].remove(entity_bare) cache[C.CONTACT_GROUPS] = groups for group in groups: self._groups.setdefault(group, {}).setdefault('jids', set()).add(entity_bare)