From 446fa8ea82f0665fecc96c9bed647d9c03cf30ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 25 Jan 2020 12:40:18 +0100 Subject: Ensure muc history messages are considered history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/core/handlers.py | 6 ++++++ poezio/tabs/muctab.py | 2 ++ 2 files changed, 8 insertions(+) (limited to 'poezio') diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index aa392d40..3e2a20a0 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -754,6 +754,11 @@ class HandlerCore: old_state = tab.state 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 if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None: replaced_id = message['replace']['id'] @@ -778,6 +783,7 @@ class HandlerCore: txt=body, time=date, nickname=nick_from, + history=history, delayed=delayed, identifier=message['id'], jid=message['from'], diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 68e0f24d..336f3fe4 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -76,6 +76,8 @@ class MucTab(ChatTab): self.users = [] # type: List[User] # private conversations 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_from = '' # Self ping event, so we can cancel it when we leave the room -- cgit v1.2.3