Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0048.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 | 5ba98fd6c9a4 |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2986:37b55d87d027 | 2987:8990ed9aad31 |
---|---|
117 if bookmarks is not None: | 117 if bookmarks is not None: |
118 for (room_jid, data) in bookmarks[XEP_0048.MUC_TYPE].items(): | 118 for (room_jid, data) in bookmarks[XEP_0048.MUC_TYPE].items(): |
119 if data.get("autojoin", "false") == "true": | 119 if data.get("autojoin", "false") == "true": |
120 nick = data.get("nick", client.jid.user) | 120 nick = data.get("nick", client.jid.user) |
121 self.host.plugins["XEP-0045"].join(client, room_jid, nick, {}) | 121 self.host.plugins["XEP-0045"].join(client, room_jid, nick, {}) |
122 | |
123 # we don't use a DeferredList to gather result here, as waiting for all room would | |
124 # slow down a lot the connection process, and result in a bad user experience. | |
122 | 125 |
123 @defer.inlineCallbacks | 126 @defer.inlineCallbacks |
124 def _getServerBookmarks(self, storage_type, profile): | 127 def _getServerBookmarks(self, storage_type, profile): |
125 """Get distants bookmarks | 128 """Get distants bookmarks |
126 | 129 |