# HG changeset patch # User Goffi # Date 1562335095 -7200 # Node ID 8990ed9aad311b0dfe5e0176e7fee0964e59fd07 # Parent 37b55d87d0271efb179d804df1877bb75c0280c6 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 diff -r 37b55d87d027 -r 8990ed9aad31 sat/plugins/plugin_xep_0048.py --- a/sat/plugins/plugin_xep_0048.py Tue Jul 02 19:36:27 2019 +0200 +++ b/sat/plugins/plugin_xep_0048.py Fri Jul 05 15:58:15 2019 +0200 @@ -120,6 +120,9 @@ nick = data.get("nick", client.jid.user) self.host.plugins["XEP-0045"].join(client, room_jid, nick, {}) + # we don't use a DeferredList to gather result here, as waiting for all room would + # slow down a lot the connection process, and result in a bad user experience. + @defer.inlineCallbacks def _getServerBookmarks(self, storage_type, profile): """Get distants bookmarks diff -r 37b55d87d027 -r 8990ed9aad31 sat_frontends/quick_frontend/quick_contact_list.py --- a/sat_frontends/quick_frontend/quick_contact_list.py Tue Jul 02 19:36:27 2019 +0200 +++ b/sat_frontends/quick_frontend/quick_contact_list.py Fri Jul 05 15:58:15 2019 +0200 @@ -498,6 +498,8 @@ else: self._specials.add(entity) cache[C.CONTACT_MAIN_RESOURCE] = None + if 'nick' in cache: + del cache['nick'] # now the attributes we keep in cache # XXX: if entity is a full jid, we store the value for the resource only