quick frontend (chat): added a property to Message which is True when message comes from history

This commit is contained in:
Goffi 2018-05-10 08:34:44 +02:00
commit 90b8f4be32

View file

@ -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()