--- a/mod_rest/mod_rest.lua Mon Dec 30 05:17:18 2019 +0100
+++ b/mod_rest/mod_rest.lua Mon Dec 30 05:18:52 2019 +0100
@@ -120,6 +120,12 @@
local function handle_stanza(event)
local stanza, origin = event.stanza, event.origin;
local reply_needed = stanza.name == "iq";
+ local receipt;
+
+ if stanza.name == "message" and stanza.attr.id and stanza:get_child("urn:xmpp:receipts", "request") then
+ reply_needed = true;
+ receipt = st.stanza("received", { xmlns = "urn:xmpp:receipts", id = stanza.id });
+ end
http.request(rest_url, {
body = tostring(stanza),
@@ -179,6 +185,10 @@
end
end
+ if receipt then
+ reply:add_direct_child(receipt);
+ end
+
origin.send(reply);
end);