Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
2581:395a3d1c2888 | 2582:2e6864b1d577 |
---|---|
69 # special entities (groupchat, gateways, etc) | 69 # special entities (groupchat, gateways, etc) |
70 # may be bare or full jid | 70 # may be bare or full jid |
71 self._specials = set() | 71 self._specials = set() |
72 | 72 |
73 # group data contain jids in groups and misc frontend data | 73 # group data contain jids in groups and misc frontend data |
74 # None key is used for jids with not group | 74 # None key is used for jids with no group |
75 self._groups = {} # groups to group data map | 75 self._groups = {} # groups to group data map |
76 | 76 |
77 # contacts in roster (bare jids) | 77 # contacts in roster (bare jids) |
78 self._roster = set() | 78 self._roster = set() |
79 | 79 |
435 try: | 435 try: |
436 cache_attr[attribute].pop(value) | 436 cache_attr[attribute].pop(value) |
437 except KeyError: | 437 except KeyError: |
438 pass | 438 pass |
439 else: | 439 else: |
440 if attribute == 'nick' and self.isSpecial(entity, C.CONTACT_SPECIAL_GROUP): | |
441 # we don't want to keep nick for MUC rooms | |
442 # FIXME: this is here as plugin XEP-0054 can link resource's nick with bare jid | |
443 # which in the case of MUC set the nick for the whole MUC | |
444 # resulting in bad name displayed in some frontends | |
445 continue | |
440 cache_attr[attribute] = value | 446 cache_attr[attribute] = value |
441 | 447 |
442 # we can update the display | 448 # we can update the display |
443 self.update([entity], update_type, self.profile) | 449 self.update([entity], update_type, self.profile) |
444 | 450 |