mod_rest: Fix replying to groupchat messages
authorKim Alvefur <zash@zash.se>
Wed, 01 Jan 2020 18:41:04 +0100
changeset 3825 11272a3233ce
parent 3824 d3757e089433
child 3826 f0a1d113dce4
mod_rest: Fix replying to groupchat messages Groupchat replies need to go back to the room instead of the participants full JID
mod_rest/mod_rest.lua
--- 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