Diff

mod_rest/mod_rest.lua @ 3821:11272a3233ce

mod_rest: Fix replying to groupchat messages Groupchat replies need to go back to the room instead of the participants full JID
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jan 2020 18:41:04 +0100
parent 3816:8473fd2d09c1
child 3824:a0b8ec44a36b
line wrap: on
line diff
--- a/mod_rest/mod_rest.lua	Wed Jan 01 18:11:55 2020 +0100
+++ b/mod_rest/mod_rest.lua	Wed Jan 01 18:41:04 2020 +0100
@@ -220,6 +220,9 @@
 						type = parsed.attr.type,
 						["xml:lang"] = parsed.attr["xml:lang"],
 					};
+					if parsed.name == "message" and parsed.attr.type == "groupchat" then
+						parsed.attr.to = jid.bare(stanza.attr.from);
+					end
 					if parsed.name == "iq" or parsed.attr.type == "error" then
 						parsed.attr.id = stanza.attr.id;
 					end