diff sat_frontends/quick_frontend/quick_contact_list.py @ 2582:2e6864b1d577

quick frontend (contact list): don't store "nick" for group contacts: plugin XEP-0054 may associate a "nick" with a bare jid, which in case of MUC can cause trouble (Primitivus for instance will use the nick instead of the name of the room). This hack avoid this issue for now.
author Goffi <goffi@goffi.org>
date Fri, 11 May 2018 17:13:58 +0200
parents 26edcf3a30eb
children 81b70eeb710f
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_contact_list.py	Fri May 11 17:11:47 2018 +0200
+++ b/sat_frontends/quick_frontend/quick_contact_list.py	Fri May 11 17:13:58 2018 +0200
@@ -71,7 +71,7 @@
         self._specials = set()
 
         # group data contain jids in groups and misc frontend data
-        # None key is used for jids with not group
+        # None key is used for jids with no group
         self._groups = {}  # groups to group data map
 
         # contacts in roster (bare jids)
@@ -437,6 +437,12 @@
                 except KeyError:
                     pass
             else:
+                if attribute == 'nick' and self.isSpecial(entity, C.CONTACT_SPECIAL_GROUP):
+                    # we don't want to keep nick for MUC rooms
+                    # FIXME: this is here as plugin XEP-0054 can link resource's nick with bare jid
+                    #        which in the case of MUC set the nick for the whole MUC
+                    #        resulting in bad name displayed in some frontends
+                    continue
                 cache_attr[attribute] = value
 
         # we can update the display