Ensure muc history messages are considered history

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2020-01-25 12:40:18 +01:00 committed by mathieui
parent 961f6c1755
commit 446fa8ea82
2 changed files with 8 additions and 0 deletions

View file

@ -754,6 +754,11 @@ class HandlerCore:
old_state = tab.state old_state = tab.state
delayed, date = common.find_delayed_tag(message) delayed, date = common.find_delayed_tag(message)
history = (tab.last_message_was_history is None and delayed) or \
(tab.last_message_was_history and delayed)
tab.last_message_was_history = history
replaced = False replaced = False
if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None: if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None:
replaced_id = message['replace']['id'] replaced_id = message['replace']['id']
@ -778,6 +783,7 @@ class HandlerCore:
txt=body, txt=body,
time=date, time=date,
nickname=nick_from, nickname=nick_from,
history=history,
delayed=delayed, delayed=delayed,
identifier=message['id'], identifier=message['id'],
jid=message['from'], jid=message['from'],

View file

@ -76,6 +76,8 @@ class MucTab(ChatTab):
self.users = [] # type: List[User] self.users = [] # type: List[User]
# private conversations # private conversations
self.privates = [] # type: List[Tab] self.privates = [] # type: List[Tab]
# Used to check if we are still receiving muc history
self.last_message_was_history = None # type: Optional[bool]
self.topic = '' self.topic = ''
self.topic_from = '' self.topic_from = ''
# Self ping event, so we can cancel it when we leave the room # Self ping event, so we can cancel it when we leave the room