comparison frontends/src/quick_frontend/quick_contact_list.py @ 1306:789e86a8919d frontends_multi_profiles

quick_frontend: remove the contact from the groups it has been removed from
author souliane <souliane@mailoo.org>
date Fri, 06 Feb 2015 19:31:13 +0100
parents 3dc7f61677bb
children 7a3a232d4938 7c2289090b9b
comparison
equal deleted inserted replaced
1305:3dc7f61677bb 1306:789e86a8919d
234 234
235 # we set groups and fill self._groups accordingly 235 # we set groups and fill self._groups accordingly
236 if groups is not None: 236 if groups is not None:
237 if not groups: 237 if not groups:
238 groups = [None] # [None] is the default group 238 groups = [None] # [None] is the default group
239 if C.CONTACT_GROUPS in cache:
240 # 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]
241 for group in [group for group in cache[C.CONTACT_GROUPS] if group not in groups]:
242 self._groups[group]['jids'].remove(entity_bare)
239 cache[C.CONTACT_GROUPS] = groups 243 cache[C.CONTACT_GROUPS] = groups
240 for group in groups: 244 for group in groups:
241 self._groups.setdefault(group, {}).setdefault('jids', set()).add(entity_bare) 245 self._groups.setdefault(group, {}).setdefault('jids', set()).add(entity_bare)
242 246
243 # special entities management 247 # special entities management