Added 'reverse' parameter in mam and rsm plugins

This commit is contained in:
Madhur Garg 2019-07-03 10:31:18 +05:30
parent 47968963b1
commit dbc9758311
2 changed files with 4 additions and 4 deletions

View File

@ -169,6 +169,6 @@ class XEP_0059(BasePlugin):
results -- The name of the interface containing the results -- The name of the interface containing the
query results (typically just 'substanzas'). query results (typically just 'substanzas').
""" """
return ResultIterator(stanza, interface, results, return ResultIterator(stanza, interface, results, reverse=reverse,
recv_interface=recv_interface, pre_cb=pre_cb, recv_interface=recv_interface, pre_cb=pre_cb,
post_cb=post_cb) post_cb=post_cb)

View File

@ -3,7 +3,7 @@
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of Slixmpp. This file is part of Slixmpp.
See the file LICENSE for copying permissio See the file LICENSE for copying permission
""" """
import logging import logging
@ -42,7 +42,7 @@ class XEP_0313(BasePlugin):
register_stanza_plugin(stanza.Fin, self.xmpp['xep_0059'].stanza.Set) register_stanza_plugin(stanza.Fin, self.xmpp['xep_0059'].stanza.Set)
def retrieve(self, jid=None, start=None, end=None, with_jid=None, ifrom=None, def retrieve(self, jid=None, start=None, end=None, with_jid=None, ifrom=None,
timeout=None, callback=None, iterator=False, rsm=None): reverse=False, timeout=None, callback=None, iterator=False, rsm=None):
iq = self.xmpp.Iq() iq = self.xmpp.Iq()
query_id = iq['id'] query_id = iq['id']
@ -72,7 +72,7 @@ class XEP_0313(BasePlugin):
result['mam']['results'] = results result['mam']['results'] = results
if iterator: if iterator:
return self.xmpp['xep_0059'].iterate(iq, 'mam', 'results', return self.xmpp['xep_0059'].iterate(iq, 'mam', 'results', reverse=reverse,
recv_interface='mam_fin', recv_interface='mam_fin',
pre_cb=pre_cb, post_cb=post_cb) pre_cb=pre_cb, post_cb=post_cb)