summaryrefslogtreecommitdiff
path: root/poezio/tabs/basetabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-02-15 23:05:23 +0100
committerMaxime Buquet <pep@bouah.net>2022-03-23 15:38:00 +0100
commitdef167791d099ffecb5a4b5a5582dce99e319987 (patch)
treec542f6d22bf8c5f8ca3ef42fd2981c74c18132a5 /poezio/tabs/basetabs.py
parent6174ca70d9bc36fde9d0a0c08ccb67e874a4711c (diff)
downloadpoezio-def167791d099ffecb5a4b5a5582dce99e319987.tar.gz
poezio-def167791d099ffecb5a4b5a5582dce99e319987.tar.bz2
poezio-def167791d099ffecb5a4b5a5582dce99e319987.tar.xz
poezio-def167791d099ffecb5a4b5a5582dce99e319987.zip
fix: do not triplicate messages on /message tab openings
add a synchronization primitive to avoid /say until the logs are loaded and synced (otherwise we do the /say THEN the message we just sent can be loaded from the archive, while also being displayed)
Diffstat (limited to 'poezio/tabs/basetabs.py')
-rw-r--r--poezio/tabs/basetabs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index c88a8a10..44330782 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -1000,6 +1000,7 @@ class OneToOneTab(ChatTab):
self.__status = Status("", "")
self.last_remote_message = datetime.now()
+ self._initial_log = asyncio.Event()
# Set to true once the first disco is done
self.__initial_disco = False
@@ -1036,7 +1037,7 @@ class OneToOneTab(ChatTab):
elif use_log and initial:
asyncio.create_task(self.handle_message(initial, display=False))
asyncio.create_task(
- LogLoader(logger, self, use_log).tab_open()
+ LogLoader(logger, self, use_log, self._initial_log).tab_open()
)
async def handle_message(self, msg: SMessage, display: bool = True):