quick frontend (chat): added Message.main_message_xhtml property to get XHTML content
This commit is contained in:
parent
b19c00773b
commit
63b1c9af14
1 changed files with 10 additions and 1 deletions
|
|
@ -91,7 +91,7 @@ class Message(object):
|
|||
|
||||
@property
|
||||
def main_message(self):
|
||||
"""Return currently displayed message"""
|
||||
"""currently displayed message"""
|
||||
if self.parent.lang in self.message:
|
||||
self.selected_lang = self.parent.lang
|
||||
return self.message[self.parent.lang]
|
||||
|
|
@ -107,6 +107,15 @@ class Message(object):
|
|||
log.error(u"Can't find message for uid {}".format(self.uid))
|
||||
return ''
|
||||
|
||||
@property
|
||||
def main_message_xhtml(self):
|
||||
"""rich message"""
|
||||
xhtml = {k:v for k,v in self.extra.iteritems() if 'html' in k}
|
||||
if xhtml:
|
||||
# FIXME: we only return first found value for now
|
||||
return next(xhtml.itervalues())
|
||||
|
||||
|
||||
@property
|
||||
def time_text(self):
|
||||
"""Return timestamp in a nicely formatted way"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue