# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1551700591 -3600
# Node ID a44f562e01a53f552687dc1fd784a855de635b73
# Parent  ec353524b739a887ac0695039f3fdc266f88dc3d
mod_muc_mam: Strip the stanza 'to' attribute (fixes #1259)

diff -r ec353524b739 -r a44f562e01a5 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);