mod_rest: Ensure MAM result-iq is included in results from remote hosts
authorKim Alvefur <zash@zash.se>
Mon, 16 May 2022 20:31:58 +0200
changeset 4946 83a54f4af94c
parent 4945 e7b9bc629ecc
child 4947 e67cc71727ca
mod_rest: Ensure MAM result-iq is included in results from remote hosts Needed for the same reason as the special message handling, the remote route does not pass our origin.send() here
mod_rest/mod_rest.lua
--- a/mod_rest/mod_rest.lua	Mon May 16 19:47:09 2022 +0200
+++ b/mod_rest/mod_rest.lua	Mon May 16 20:31:58 2022 +0200
@@ -389,6 +389,10 @@
 			function (result)
 				module:log("debug", "Sending[rest]: %s", result.stanza:top_tag());
 				response.headers.content_type = send_type;
+				local tail = responses[#responses];
+				if tail.name ~= "iq" or tail.attr.from ~= result.stanza.attr.from or tail.attr.id ~= result.stanza.attr.id then
+					origin.send(result.stanza);
+				end
 				if responses[2] then
 					return encode(send_type, responses);
 				end