# HG changeset patch # User Goffi # Date 1474812464 -7200 # Node ID 3a0a7e5cef49012ffeeeed3984cdcc1c32b9c578 # Parent 95ad70ad815ccd2b4415c3961b2838f31da32b58 quick frontend (chat): added Message.main_message_xhtml property to get XHTML content diff -r 95ad70ad815c -r 3a0a7e5cef49 frontends/src/quick_frontend/quick_chat.py --- a/frontends/src/quick_frontend/quick_chat.py Sun Sep 25 15:41:43 2016 +0200 +++ b/frontends/src/quick_frontend/quick_chat.py Sun Sep 25 16:07:44 2016 +0200 @@ -91,7 +91,7 @@ @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] @@ -108,6 +108,15 @@ 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""" # if the message was sent before today, we print the full date