comparison frontends/src/quick_frontend/quick_chat.py @ 2015:20fb71b656e3

quick_frontend, primitivus (contact_list): improved and simplified handling of "special" entities: - special_extras has been removed - specials handle all entities (bare + full) in a single set
author Goffi <goffi@goffi.org>
date Sun, 24 Jul 2016 17:47:09 +0200
parents b536dd121da1
children 7199e6bdb94e
comparison
equal deleted inserted replaced
2014:0694a2611bad 2015:20fb71b656e3
104 try: 104 try:
105 return self.extra['user_nick'] 105 return self.extra['user_nick']
106 except KeyError: 106 except KeyError:
107 log.error(u"extra data is missing user nick for uid {}".format(self.uid)) 107 log.error(u"extra data is missing user nick for uid {}".format(self.uid))
108 return "" 108 return ""
109 if self.parent.type == C.CHAT_GROUP or entity in contact_list.getSpecialExtras(C.CONTACT_SPECIAL_GROUP): 109 if self.parent.type == C.CHAT_GROUP or entity in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP):
110 return entity.resource or "" 110 return entity.resource or ""
111 if entity.bare in contact_list: 111 if entity.bare in contact_list:
112 return contact_list.getCache(entity, 'nick') or contact_list.getCache(entity, 'name') or entity.node or entity 112 return contact_list.getCache(entity, 'nick') or contact_list.getCache(entity, 'name') or entity.node or entity
113 return entity.node or entity 113 return entity.node or entity
114 114