comparison sat_frontends/quick_frontend/quick_contact_list.py @ 2987:8990ed9aad31

quick_frontend (contact list): fixed `nick` use for groupchat: during the profile connection workflow, joined rooms are retrieved, then presence are filled, all asynchronously. In some cases, all rooms may not be joined when presence are filled, resulting in cache being already filled with a `nick` when cache is set for the room itself. Because of that, a `nick` may be displayed in contact list instead of MUC local part. This patch fixes it by removing `nick` if it exists when cache a MUC room. fix 305
author Goffi <goffi@goffi.org>
date Fri, 05 Jul 2019 15:58:15 +0200
parents bad0b4280b77
children ab2696e34d29
comparison
equal deleted inserted replaced
2986:37b55d87d027 2987:8990ed9aad31
496 del attributes[C.CONTACT_SPECIAL] 496 del attributes[C.CONTACT_SPECIAL]
497 self._specials.remove(entity) 497 self._specials.remove(entity)
498 else: 498 else:
499 self._specials.add(entity) 499 self._specials.add(entity)
500 cache[C.CONTACT_MAIN_RESOURCE] = None 500 cache[C.CONTACT_MAIN_RESOURCE] = None
501 if 'nick' in cache:
502 del cache['nick']
501 503
502 # now the attributes we keep in cache 504 # now the attributes we keep in cache
503 # XXX: if entity is a full jid, we store the value for the resource only 505 # XXX: if entity is a full jid, we store the value for the resource only
504 cache_attr = ( 506 cache_attr = (
505 cache[C.CONTACT_RESOURCES].setdefault(entity.resource, {}) 507 cache[C.CONTACT_RESOURCES].setdefault(entity.resource, {})