summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0313/mam.py
diff options
context:
space:
mode:
authorroot <madhurgarg96@gmail.com>2019-08-29 11:25:26 +0530
committerMaxime “pep” Buquet <pep@bouah.net>2019-09-08 14:22:48 +0200
commit11f707987dd3c1b80918ce4db81d31cd98a07ad1 (patch)
tree5c6abd5247327e51f4e8b548f61ffb8ba05efd82 /slixmpp/plugins/xep_0313/mam.py
parentdb13794e0f0218af3ae76e852a704a6e86244b29 (diff)
downloadslixmpp-11f707987dd3c1b80918ce4db81d31cd98a07ad1.tar.gz
slixmpp-11f707987dd3c1b80918ce4db81d31cd98a07ad1.tar.bz2
slixmpp-11f707987dd3c1b80918ce4db81d31cd98a07ad1.tar.xz
slixmpp-11f707987dd3c1b80918ce4db81d31cd98a07ad1.zip
Added amount parameter, so that limit on the msgs received per query can be changed.
Diffstat (limited to 'slixmpp/plugins/xep_0313/mam.py')
-rw-r--r--slixmpp/plugins/xep_0313/mam.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0313/mam.py b/slixmpp/plugins/xep_0313/mam.py
index f78b62fa..e3268e9b 100644
--- a/slixmpp/plugins/xep_0313/mam.py
+++ b/slixmpp/plugins/xep_0313/mam.py
@@ -53,9 +53,12 @@ class XEP_0313(BasePlugin):
iq['mam']['start'] = start
iq['mam']['end'] = end
iq['mam']['with'] = with_jid
+ amount = 10
if rsm:
for key, value in rsm.items():
iq['mam']['rsm'][key] = str(value)
+ if key is 'max':
+ amount = value
cb_data = {}
def pre_cb(query):
@@ -72,8 +75,8 @@ class XEP_0313(BasePlugin):
result['mam']['results'] = results
if iterator:
- return self.xmpp['xep_0059'].iterate(iq, 'mam', 'results', reverse=reverse,
- recv_interface='mam_fin',
+ return self.xmpp['xep_0059'].iterate(iq, 'mam', 'results', amount=amount,
+ reverse=reverse, recv_interface='mam_fin',
pre_cb=pre_cb, post_cb=post_cb)
collector = Collector(