summaryrefslogtreecommitdiff
path: root/poezio/log_loader.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-06-22 23:16:42 +0200
committermathieui <mathieui@mathieui.net>2021-06-22 23:26:49 +0200
commit2b76f72e4d58eb540aa19173a050142f5199ff81 (patch)
treeccca7dbf36c20e980e3a69c0028af264702c75f6 /poezio/log_loader.py
parent3035f4ed4d5ef5d581c7f224833392526bfd1bc5 (diff)
downloadpoezio-2b76f72e4d58eb540aa19173a050142f5199ff81.tar.gz
poezio-2b76f72e4d58eb540aa19173a050142f5199ff81.tar.bz2
poezio-2b76f72e4d58eb540aa19173a050142f5199ff81.tar.xz
poezio-2b76f72e4d58eb540aa19173a050142f5199ff81.zip
Fix the message doubling situation
Add an "initial" parameter for onetoonetabs, and delay the reception of the message until the sync is done (and possibly ignore the message if it is fetched by the sync). Fixes #3542
Diffstat (limited to 'poezio/log_loader.py')
-rw-r--r--poezio/log_loader.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/poezio/log_loader.py b/poezio/log_loader.py
index 8fd0ed82..aa645c30 100644
--- a/poezio/log_loader.py
+++ b/poezio/log_loader.py
@@ -309,6 +309,7 @@ class MAMFiller:
self.future = asyncio.ensure_future(self.fetch_routine())
self.done = asyncio.Event()
self.limit = limit
+ self.result = 0
def cancel(self) -> None:
"""Cancel the routine and signal the end."""
@@ -334,6 +335,7 @@ class MAMFiller:
'Fetched %s messages to fill local logs for %s',
len(messages), self.tab.jid,
)
+ self.result = len(messages)
except NoMAMSupportException:
log.debug('The entity %s does not support MAM', self.tab.jid)
return