From bc8386909078812b1e6a6d605cf384a2aceb2329 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 11 May 2018 17:13:58 +0200 Subject: [PATCH] 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. --- sat_frontends/quick_frontend/quick_app.py | 1 - sat_frontends/quick_frontend/quick_contact_list.py | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index 6ac64576..5cb3c6b1 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -570,7 +570,6 @@ class QuickApp(object): raise NotImplementedError def presenceUpdateHandler(self, entity_s, show, priority, statuses, profile): - log.debug(_(u"presence update for %(entity)s (show=%(show)s, priority=%(priority)s, statuses=%(statuses)s) [profile:%(profile)s]") % {'entity': entity_s, C.PRESENCE_SHOW: show, C.PRESENCE_PRIORITY: priority, C.PRESENCE_STATUSES: statuses, 'profile': profile}) entity = jid.JID(entity_s) diff --git a/sat_frontends/quick_frontend/quick_contact_list.py b/sat_frontends/quick_frontend/quick_contact_list.py index e279cba5..b3c3cfcc 100644 --- a/sat_frontends/quick_frontend/quick_contact_list.py +++ b/sat_frontends/quick_frontend/quick_contact_list.py @@ -71,7 +71,7 @@ class ProfileContactList(object): 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 @@ class ProfileContactList(object): 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