aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_muc_mam.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua
index 963e5255..d414a449 100644
--- a/plugins/mod_muc_mam.lua
+++ b/plugins/mod_muc_mam.lua
@@ -213,6 +213,7 @@ module:hook("iq-set/bare/"..xmlns_mam..":query", function(event)
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);
@@ -334,6 +335,7 @@ local function save_to_history(self, stanza)
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);
@@ -344,12 +346,13 @@ local function save_to_history(self, stanza)
-- Policy check
if not archiving_enabled(self) then return end -- Don't log
- -- And stash it
+ -- Save the type in the 'with' field, allows storing presence without conflicts
local with = stanza.name
if stanza.attr.type then
with = with .. "<" .. stanza.attr.type
end
+ -- And stash it
local id = archive:append(room_node, nil, stored_stanza, time_now(), with);
if id then