Changeset

4742:b7df2c61a144

mod_rest: Add support for mapping of XEP-0313 query iqs
author Kim Alvefur <zash@zash.se>
date Thu, 04 Nov 2021 20:03:36 +0100
parents 4741:3f2342eacb26
children 4743:0a501df823fd
files mod_rest/jsonmap.lib.lua mod_rest/res/schema-xmpp.json
diffstat 2 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/jsonmap.lib.lua	Thu Nov 04 19:46:38 2021 +0100
+++ b/mod_rest/jsonmap.lib.lua	Thu Nov 04 20:03:36 2021 +0100
@@ -19,6 +19,8 @@
 		schema.properties.message.properties.archive.properties.forward = schema.properties.message.properties.forwarded;
 		schema.properties.message.properties.forwarded.properties.delay = schema._common.delay;
 		schema.properties.message.properties.forwarded.properties.message.properties = schema.properties.message.properties;
+		schema.properties.iq.properties.archive.properties.form = schema._common.dataform;
+		schema.properties.iq.properties.archive.properties.page = schema._common.rsm;
 		schema._common = nil;
 	end
 end
--- a/mod_rest/res/schema-xmpp.json	Thu Nov 04 19:46:38 2021 +0100
+++ b/mod_rest/res/schema-xmpp.json	Thu Nov 04 20:03:36 2021 +0100
@@ -200,6 +200,27 @@
    "properties" : {
       "iq" : {
          "properties" : {
+            "archive" : {
+               "properties" : {
+                  "form" : {
+                     "$ref" : "#_common/dataform"
+                  },
+                  "page" : {
+                     "$ref" : "#_common/rsm"
+                  },
+                  "queryid" : {
+                     "type" : "string",
+                     "xml" : {
+                        "attribute" : true
+                     }
+                  }
+               },
+               "type" : "object",
+               "xml" : {
+                  "name" : "query",
+                  "namespace" : "urn:xmpp:mam:2"
+               }
+            },
             "extdisco" : {
                "properties" : {
                   "services" : {