Comparison

plugins/mod_muc_mam.lua @ 9841:a44f562e01a5 0.11

mod_muc_mam: Strip the stanza 'to' attribute (fixes #1259)
author Kim Alvefur <zash@zash.se>
date Mon, 04 Mar 2019 12:56:31 +0100
parent 9552:87e25d352de3
child 9842:6f39be2e0be5
comparison
equal deleted inserted replaced
9840:ec353524b739 9841:a44f562e01a5
206 end); 206 end);
207 end 207 end
208 if not is_stanza(item) then 208 if not is_stanza(item) then
209 item = st.deserialize(item); 209 item = st.deserialize(item);
210 end 210 end
211 item.attr.to = nil;
211 item.attr.xmlns = "jabber:client"; 212 item.attr.xmlns = "jabber:client";
212 fwd_st:add_child(item); 213 fwd_st:add_child(item);
213 214
214 if not first then first = id; end 215 if not first then first = id; end
215 last = id; 216 last = id;
327 328
328 local stored_stanza = stanza; 329 local stored_stanza = stanza;
329 330
330 if stanza.name == "message" and self:get_whois() == "anyone" then 331 if stanza.name == "message" and self:get_whois() == "anyone" then
331 stored_stanza = st.clone(stanza); 332 stored_stanza = st.clone(stanza);
333 stored_stanza.attr.to = nil;
332 local actor = jid_bare(self._occupants[stanza.attr.from].jid); 334 local actor = jid_bare(self._occupants[stanza.attr.from].jid);
333 local affiliation = self:get_affiliation(actor) or "none"; 335 local affiliation = self:get_affiliation(actor) or "none";
334 local role = self:get_role(actor) or self:get_default_role(affiliation); 336 local role = self:get_role(actor) or self:get_default_role(affiliation);
335 stored_stanza:add_direct_child(st.stanza("x", { xmlns = xmlns_muc_user }) 337 stored_stanza:add_direct_child(st.stanza("x", { xmlns = xmlns_muc_user })
336 :tag("item", { affiliation = affiliation; role = role; jid = actor })); 338 :tag("item", { affiliation = affiliation; role = role; jid = actor }));