aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_muc_mam.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-04 13:46:09 +0100
committerKim Alvefur <zash@zash.se>2019-03-04 13:46:09 +0100
commit2326bed3c7b2386aa1706ad0e760827ef2e165ce (patch)
treee47cbfb67c4f98b179baec19c2f4fd66e62f7132 /plugins/mod_muc_mam.lua
parent9c9d32e7e69af9aa59c1937b91bc41525d584144 (diff)
parent09a662026a3fc4c69eda9d8ef8862abac5569625 (diff)
downloadprosody-2326bed3c7b2386aa1706ad0e760827ef2e165ce.tar.gz
prosody-2326bed3c7b2386aa1706ad0e760827ef2e165ce.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_muc_mam.lua')
-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