# HG changeset patch # User souliane # Date 1429884646 -7200 # Node ID 0e518415d03af3dd621d961a78e8b7d7f9b47f11 # Parent 1e833970b7f02ea70320cc3260ee070d4c07c3e8 display the resource in the chat dialog when printing a private MUC message diff -r 1e833970b7f0 -r 0e518415d03a frontends/src/quick_frontend/quick_chat.py --- a/frontends/src/quick_frontend/quick_chat.py Fri Apr 24 14:57:09 2015 +0200 +++ b/frontends/src/quick_frontend/quick_chat.py Fri Apr 24 16:10:46 2015 +0200 @@ -158,9 +158,9 @@ def _get_nick(self, entity): """Return nick of this entity when possible""" - if self.type == C.CHAT_GROUP: + contact_list = self.host.contact_lists[self.profile] + if self.type == C.CHAT_GROUP or entity in contact_list.getSpecialExtras(C.CONTACT_SPECIAL_GROUP): return entity.resource - contact_list = self.host.contact_lists[self.profile] if entity.bare in contact_list: return contact_list.getCache(entity,'nick') or contact_list.getCache(entity,'name') or entity.node or entity return entity.node or entity diff -r 1e833970b7f0 -r 0e518415d03a frontends/src/quick_frontend/quick_contact_list.py --- a/frontends/src/quick_frontend/quick_contact_list.py Fri Apr 24 14:57:09 2015 +0200 +++ b/frontends/src/quick_frontend/quick_contact_list.py Fri Apr 24 16:10:46 2015 +0200 @@ -243,6 +243,18 @@ return self._specials return set([entity for entity in self._specials if self.getCache(entity, C.CONTACT_SPECIAL) == special_type]) + def getSpecialExtras(self, special_type=None): + """Return all the JIDs of the special extras entities that are related + to a special entity of the type specified by special_type. + If special_type is None, return all special extras. + + @param special_type: one of special type (e.g. C.CONTACT_SPECIAL_GROUP) or None to return all special extras. + @return: set(jid.JID) + """ + if special_type is None: + return self._special_extras + return set([extra for extra in self._special_extras if extra.bare in self.getSpecials(special_type)]) + def clearContacts(self): """Clear all the contact list""" self.unselectAll()