changeset 2078:3a0a7e5cef49

quick frontend (chat): added Message.main_message_xhtml property to get XHTML content
author Goffi <goffi@goffi.org>
date Sun, 25 Sep 2016 16:07:44 +0200
parents 95ad70ad815c
children c8e561a5b2b6
files frontends/src/quick_frontend/quick_chat.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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