From 90b8f4be329364a0621fb43161921018635e87a3 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 10 May 2018 08:34:44 +0200 Subject: [PATCH] quick frontend (chat): added a property to Message which is True when message comes from history --- sat_frontends/quick_frontend/quick_chat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sat_frontends/quick_frontend/quick_chat.py b/sat_frontends/quick_frontend/quick_chat.py index e3e3bf3d..19afe61a 100644 --- a/sat_frontends/quick_frontend/quick_chat.py +++ b/sat_frontends/quick_frontend/quick_chat.py @@ -89,6 +89,11 @@ class Message(object): except AttributeError: 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""" @@ -471,6 +476,7 @@ class QuickChat(quick_widgets.QuickWidget): # 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()