plugins XEP-0060, XEP-0313: implemented Order-By protoXEP:

new "order_by" key can be used in extra data, value can be, for now, "creation" or "modification".
This commit is contained in:
Goffi 2019-01-06 17:36:51 +01:00
commit 3e63d54e3d

View file

@ -162,6 +162,13 @@ class XEP_0313(object):
if form_args:
mam_args["form"] = mam.buildForm(**form_args)
# we only set orderBy if we have other MAM args
# else we would make a MAM query while it's not expected
if u"order_by" in extra and mam_args:
order_by = extra.pop(u"order_by")
assert isinstance(order_by, list)
mam_args["orderBy"] = order_by
return mam.MAMRequest(**mam_args) if mam_args else None
def serialise(self, mam_response, data=None):