comparison frontends/src/quick_frontend/quick_chat.py @ 1993:981e2abbb56c

quick_frontend, primitivus: moved main_message property to quick_frontend
author Goffi <goffi@goffi.org>
date Sun, 10 Jul 2016 12:26:13 +0200
parents a9908e751c42
children 19b9d3f8a6c7
comparison
equal deleted inserted replaced
1992:d5befe7253aa 1993:981e2abbb56c
77 def mention(self): 77 def mention(self):
78 try: 78 try:
79 return self._mention 79 return self._mention
80 except AttributeError: 80 except AttributeError:
81 return False 81 return False
82
83 @property
84 def main_message(self):
85 """Return currently displayed message"""
86 if self.parent.lang in self.message:
87 self.selected_lang = self.parent.lang
88 return self.message[self.parent.lang]
89 try:
90 self.selected_lang = ''
91 return self.message['']
92 except KeyError:
93 try:
94 lang, mess = self.message.iteritems().next()
95 self.selected_lang = lang
96 return mess
97 except StopIteration:
98 log.error(u"Can't find message for uid {}".format(self.mess_data.uid))
82 99
83 def getNick(self, entity): 100 def getNick(self, entity):
84 """Return nick of an entity when possible""" 101 """Return nick of an entity when possible"""
85 contact_list = self.host.contact_lists[self.profile] 102 contact_list = self.host.contact_lists[self.profile]
86 if self.type == C.MESS_TYPE_INFO and self.info_type in ROOM_USER_MOVED: 103 if self.type == C.MESS_TYPE_INFO and self.info_type in ROOM_USER_MOVED: