mod_muc_mam: Strip the stanza 'to' attribute (fixes #1259) 0.11
authorKim Alvefur <zash@zash.se>
Mon, 04 Mar 2019 12:56:31 +0100
branch0.11
changeset 9845 a44f562e01a5
parent 9844 ec353524b739
child 9846 6f39be2e0be5
mod_muc_mam: Strip the stanza 'to' attribute (fixes #1259)
plugins/mod_muc_mam.lua
--- a/plugins/mod_muc_mam.lua	Sun Mar 03 19:31:56 2019 +0100
+++ b/plugins/mod_muc_mam.lua	Mon Mar 04 12:56:31 2019 +0100
@@ -208,6 +208,7 @@
 		if not is_stanza(item) then
 			item = st.deserialize(item);
 		end
+		item.attr.to = nil;
 		item.attr.xmlns = "jabber:client";
 		fwd_st:add_child(item);
 
@@ -329,6 +330,7 @@
 
 	if stanza.name == "message" and self:get_whois() == "anyone" then
 		stored_stanza = st.clone(stanza);
+		stored_stanza.attr.to = nil;
 		local actor = jid_bare(self._occupants[stanza.attr.from].jid);
 		local affiliation = self:get_affiliation(actor) or "none";
 		local role = self:get_role(actor) or self:get_default_role(affiliation);