Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_chat.py @ 1441:b4c49c234c6b
quick_frontend (quick_chat): QuickChat._get_nick returns "" instead of None for message from the MUC
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 14 Jul 2015 16:49:29 +0200 |
parents | 0e518415d03a |
children | c74015dc2785 |
comparison
equal
deleted
inserted
replaced
1440:226bbe758b1a | 1441:b4c49c234c6b |
---|---|
158 | 158 |
159 def _get_nick(self, entity): | 159 def _get_nick(self, entity): |
160 """Return nick of this entity when possible""" | 160 """Return nick of this entity when possible""" |
161 contact_list = self.host.contact_lists[self.profile] | 161 contact_list = self.host.contact_lists[self.profile] |
162 if self.type == C.CHAT_GROUP or entity in contact_list.getSpecialExtras(C.CONTACT_SPECIAL_GROUP): | 162 if self.type == C.CHAT_GROUP or entity in contact_list.getSpecialExtras(C.CONTACT_SPECIAL_GROUP): |
163 return entity.resource | 163 return entity.resource or "" |
164 if entity.bare in contact_list: | 164 if entity.bare in contact_list: |
165 return contact_list.getCache(entity,'nick') or contact_list.getCache(entity,'name') or entity.node or entity | 165 return contact_list.getCache(entity, 'nick') or contact_list.getCache(entity, 'name') or entity.node or entity |
166 return entity.node or entity | 166 return entity.node or entity |
167 | 167 |
168 def onPrivateCreated(self, widget): | 168 def onPrivateCreated(self, widget): |
169 """Method called when a new widget for private conversation (MUC) is created""" | 169 """Method called when a new widget for private conversation (MUC) is created""" |
170 raise NotImplementedError | 170 raise NotImplementedError |