comparison frontends/src/quick_frontend/quick_chat.py @ 2167:4b78b4c7f805

core, frontends: various fixes for Libervia: - quick_app: don't fail when we can't get autodisconnect parameter - bridge: removed useless BridgeFrontend parent class - use of TypeError, unicode and list to workaround Pyjamas incompatibilities
author Goffi <goffi@goffi.org>
date Sun, 26 Feb 2017 18:23:01 +0100
parents c42aab22c2c0
children 8b37a62336c3
comparison
equal deleted inserted replaced
2166:1b3fbb76984b 2167:4b78b4c7f805
137 try: 137 try:
138 return self.extra['user_nick'] 138 return self.extra['user_nick']
139 except KeyError: 139 except KeyError:
140 log.error(u"extra data is missing user nick for uid {}".format(self.uid)) 140 log.error(u"extra data is missing user nick for uid {}".format(self.uid))
141 return "" 141 return ""
142 if self.parent.type == C.CHAT_GROUP or entity in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP): 142 # FIXME: converted getSpecials to list for pyjamas
143 if self.parent.type == C.CHAT_GROUP or entity in list(contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP)):
143 return entity.resource or "" 144 return entity.resource or ""
144 if entity.bare in contact_list: 145 if entity.bare in contact_list:
145 return contact_list.getCache(entity, 'nick') or contact_list.getCache(entity, 'name') or entity.node or entity 146 return contact_list.getCache(entity, 'nick') or contact_list.getCache(entity, 'name') or entity.node or entity
146 return entity.node or entity 147 return entity.node or entity
147 148
290 return u"Chat Widget [target: {}, type: {}, profile: {}]".format(self.target, self.type, self.profile) 291 return u"Chat Widget [target: {}, type: {}, profile: {}]".format(self.target, self.type, self.profile)
291 292
292 @staticmethod 293 @staticmethod
293 def getWidgetHash(target, profiles): 294 def getWidgetHash(target, profiles):
294 profile = list(profiles)[0] 295 profile = list(profiles)[0]
295 return profile + "\n" + target.bare 296 return profile + "\n" + unicode(target.bare)
296 297
297 @staticmethod 298 @staticmethod
298 def getPrivateHash(target, profile): 299 def getPrivateHash(target, profile):
299 """Get unique hash for private conversations 300 """Get unique hash for private conversations
300 301