diff sat_frontends/quick_frontend/quick_chat.py @ 2580:5e54afd17321

quick frontend (chat): added a property to Message which is True when message comes from history
author Goffi <goffi@goffi.org>
date Thu, 10 May 2018 08:34:44 +0200
parents 26edcf3a30eb
children 56f94936df1e
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_chat.py	Fri Apr 13 18:45:43 2018 +0200
+++ b/sat_frontends/quick_frontend/quick_chat.py	Thu May 10 08:34:44 2018 +0200
@@ -90,6 +90,11 @@
             return False
 
     @property
+    def history(self):
+        """True if message come from history"""
+        return self.extra.get('history', False)
+
+    @property
     def main_message(self):
         """currently displayed message"""
         if self.parent.lang in self.message:
@@ -471,6 +476,7 @@
                 # if ((self.type == C.CHAT_GROUP and type_ != C.MESS_TYPE_GROUPCHAT) or
                 #    (self.type == C.CHAT_ONE2ONE and type_ == C.MESS_TYPE_GROUPCHAT)):
                 #     continue
+                extra['history'] = True
                 self.messages[uid] = Message(self, uid, timestamp, from_jid, to_jid, message, subject, type_, extra, profile)
             self._onHistoryPrinted()