Software /
code /
prosody
Comparison
plugins/mod_muc_mam.lua @ 10671:5e1384298e97
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 27 Feb 2020 19:50:30 +0100 |
parent | 10585:2d8535338099 |
parent | 10670:5376f882cf82 |
child | 10683:2f0b7f1d5e75 |
comparison
equal
deleted
inserted
replaced
10669:bf81523e2ff4 | 10671:5e1384298e97 |
---|---|
359 local stored_stanza = stanza; | 359 local stored_stanza = stanza; |
360 | 360 |
361 if stanza.name == "message" and self:get_whois() == "anyone" then | 361 if stanza.name == "message" and self:get_whois() == "anyone" then |
362 stored_stanza = st.clone(stanza); | 362 stored_stanza = st.clone(stanza); |
363 stored_stanza.attr.to = nil; | 363 stored_stanza.attr.to = nil; |
364 local actor = jid_bare(self._occupants[stanza.attr.from].jid); | 364 local occupant = self._occupants[stanza.attr.from]; |
365 local affiliation = self:get_affiliation(actor) or "none"; | 365 if occupant then |
366 local role = self:get_role(actor) or self:get_default_role(affiliation); | 366 local actor = jid_bare(occupant.jid); |
367 stored_stanza:add_direct_child(st.stanza("x", { xmlns = xmlns_muc_user }) | 367 local affiliation = self:get_affiliation(actor) or "none"; |
368 :tag("item", { affiliation = affiliation; role = role; jid = actor })); | 368 local role = self:get_role(actor) or self:get_default_role(affiliation); |
369 stored_stanza:add_direct_child(st.stanza("x", { xmlns = xmlns_muc_user }) | |
370 :tag("item", { affiliation = affiliation; role = role; jid = actor })); | |
371 end | |
369 end | 372 end |
370 | 373 |
371 -- Policy check | 374 -- Policy check |
372 if not archiving_enabled(self) then return end -- Don't log | 375 if not archiving_enabled(self) then return end -- Don't log |
373 | 376 |