summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0059
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-09 19:15:27 +0100
committermathieui <mathieui@mathieui.net>2021-03-09 19:52:53 +0100
commite329eadbedf3dada89f3e7fd5e2bf5d24e995f27 (patch)
treed64922d39f462963478a10fa6aabbb68a8e71a93 /slixmpp/plugins/xep_0059
parent4cdcc4d155d1bd11afb6366f2b5efa1739788d01 (diff)
downloadslixmpp-e329eadbedf3dada89f3e7fd5e2bf5d24e995f27.tar.gz
slixmpp-e329eadbedf3dada89f3e7fd5e2bf5d24e995f27.tar.bz2
slixmpp-e329eadbedf3dada89f3e7fd5e2bf5d24e995f27.tar.xz
slixmpp-e329eadbedf3dada89f3e7fd5e2bf5d24e995f27.zip
XEP-0313: Fix off-by-one-page RSM fetching
Add a "results" interface to mam_fin, and fix some things in RSM Items just received were not taken into account because: - RSM code is checking iq['mam_fin']['results'], results were at iq['mam']['results'] - RSM handler was run after checking the number
Diffstat (limited to 'slixmpp/plugins/xep_0059')
-rw-r--r--slixmpp/plugins/xep_0059/rsm.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/slixmpp/plugins/xep_0059/rsm.py b/slixmpp/plugins/xep_0059/rsm.py
index 61752af4..085ee474 100644
--- a/slixmpp/plugins/xep_0059/rsm.py
+++ b/slixmpp/plugins/xep_0059/rsm.py
@@ -135,6 +135,9 @@ class ResultIterator(AsyncIterator):
not r[self.recv_interface]['rsm']['last']:
raise StopAsyncIteration
+ if self.post_cb:
+ self.post_cb(r)
+
if r[self.recv_interface]['rsm']['count'] and \
r[self.recv_interface]['rsm']['first_index']:
count = int(r[self.recv_interface]['rsm']['count'])
@@ -147,9 +150,6 @@ class ResultIterator(AsyncIterator):
self.start = r[self.recv_interface]['rsm']['first']
else:
self.start = r[self.recv_interface]['rsm']['last']
-
- if self.post_cb:
- self.post_cb(r)
return r
except XMPPError:
raise StopAsyncIteration