# HG changeset patch # User Kim Alvefur # Date 1582670035 -3600 # Node ID d5ecb9b9cb3b9c67227fadb7733faeb0a827506e # Parent dbebc922659768ddcaedd2c5b537fe2c6b97f333 mod_rest: Update with namespace and name of XEP-0432 diff -r dbebc9226597 -r d5ecb9b9cb3b mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Tue Feb 25 23:30:07 2020 +0100 +++ b/mod_rest/jsonmap.lib.lua Tue Feb 25 23:33:55 2020 +0100 @@ -316,8 +316,8 @@ end; }; - -- XEP-XXXX: User-defined Data Transfer - payload = { type = "func", xmlns = "urn:xmpp:udt:0", tagname = "payload", + -- XEP-0432: Simple JSON Messaging + payload = { type = "func", xmlns = "urn:xmpp:json-msg:0", tagname = "payload", st2json = function (s) local rawjson = s:get_child_text("json", "urn:xmpp:json:0"); if not rawjson then return nil, "missing-json-payload"; end @@ -330,7 +330,7 @@ end; json2st = function (s) if type(s) == "table" then - return st.stanza("payload", { xmlns = "urn:xmpp:udt:0", datatype = s.datatype }) + return st.stanza("payload", { xmlns = "urn:xmpp:json-msg:0", datatype = s.datatype }) :tag("json", { xmlns = "urn:xmpp:json:0" }):text(json.encode(s.data)); end; end