--- a/mod_rest/mod_rest.lua Sat Sep 25 11:43:31 2021 +0000
+++ b/mod_rest/mod_rest.lua Wed Sep 29 00:26:44 2021 +0200
@@ -293,8 +293,9 @@
end
if payload.name == "iq" then
+ local responses = st.stanza("xmpp");
function origin.send(stanza)
- module:send(stanza);
+ responses:add_direct_child(stanza);
end
if payload.attr.type ~= "get" and payload.attr.type ~= "set" then
@@ -307,6 +308,9 @@
function (result)
module:log("debug", "Sending[rest]: %s", result.stanza:top_tag());
response.headers.content_type = send_type;
+ if responses[2] then
+ return encode(send_type, responses);
+ end
return encode(send_type, result.stanza);
end,
function (error)