Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 4943:83a54f4af94c
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
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 16 May 2022 20:31:58 +0200 |
parents | e7b9bc629ecc |
children | e67cc71727ca |
comparison
equal
deleted
inserted
replaced
4942:e7b9bc629ecc | 4943:83a54f4af94c |
---|---|
387 | 387 |
388 local p = module:send_iq(payload, origin):next( | 388 local p = module:send_iq(payload, origin):next( |
389 function (result) | 389 function (result) |
390 module:log("debug", "Sending[rest]: %s", result.stanza:top_tag()); | 390 module:log("debug", "Sending[rest]: %s", result.stanza:top_tag()); |
391 response.headers.content_type = send_type; | 391 response.headers.content_type = send_type; |
392 local tail = responses[#responses]; | |
393 if tail.name ~= "iq" or tail.attr.from ~= result.stanza.attr.from or tail.attr.id ~= result.stanza.attr.id then | |
394 origin.send(result.stanza); | |
395 end | |
392 if responses[2] then | 396 if responses[2] then |
393 return encode(send_type, responses); | 397 return encode(send_type, responses); |
394 end | 398 end |
395 return encode(send_type, result.stanza); | 399 return encode(send_type, result.stanza); |
396 end, | 400 end, |