quick frontend (chat): added a property to Message which is True when message comes from history
This commit is contained in:
parent
2199c99d5b
commit
90b8f4be32
1 changed files with 6 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue