# HG changeset patch # User Kim Alvefur # Date 1635360197 -7200 # Node ID d71beacaec3bcb59bd80bd55d986897feba689fc # Parent 1da4b815d2fe340d0efeff02035d2e870f00ab03 mod_rest: Apply JSON mapping to items in container (e.g. MAM results etc) diff -r 1da4b815d2fe -r d71beacaec3b mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Wed Oct 27 19:12:03 2021 +0100 +++ b/mod_rest/jsonmap.lib.lua Wed Oct 27 20:43:17 2021 +0200 @@ -406,6 +406,13 @@ } local function st2json(s) + if s.name == "xmpp" then + local result = array(); + for child in s:childtags() do + result:push(st2json(child)); + end + return { xmpp = result }; + end local t = map.parse(schema.properties[s.name], s); t.kind = s.name;