# HG changeset patch # User Kim Alvefur # Date 1580853943 -3600 # Node ID 5d7df207dc2bca05a2e99ad9a69bf7d25b45df40 # Parent 44c2d36c40a4e27a5d767d2988b44c0dee29a93d mod_rest: Add final pieces of XEP-0050 (actions, note, form) Forgot to add in a previous commit. diff -r 44c2d36c40a4 -r 5d7df207dc2b mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Tue Feb 04 22:34:19 2020 +0100 +++ b/mod_rest/jsonmap.lib.lua Tue Feb 04 23:05:43 2020 +0100 @@ -250,6 +250,26 @@ sessionid = s.sessionid, status = s.status, }); + if type(s.actions) == "table" then + cmd:tag("actions", { execute = s.actions.execute }); + do + if s.actions.next == true then + cmd:tag("next"):up(); + end + if s.actions.prev == true then + cmd:tag("prev"):up(); + end + if s.actions.complete == true then + cmd:tag("complete"):up(); + end + end + cmd:up(); + elseif type(s.note) == "table" then + cmd:text_tag("note", s.note.text, { type = s.note.type }); + end + if s.form then + cmd:add_child(dataform[5](s.form)); + end return cmd; elseif type(s) == "string" then -- assume node return st.stanza("command", { xmlns = "http://jabber.org/protocol/commands", node = s });