Comparison

mod_muc_markers/mod_muc_markers.lua @ 4515:2e33eeafe962

mod_muc_markers: Prevent any markers from reaching the archive, even if untracked Original intention was to leave alone things that this module isn't handling. However markers in archives are just problematic without more advanced logic about what is markable and what is not. It also requires a more advanced query in mod_muc_rai to determine the latest markable message instead of the latest archived message. I'd rather keep the "is archivable" and "is markable" definition the same for simplicity. I don't want to introduce yet another set of rules for no reason. No markers in MAM.
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Mar 2021 15:55:02 +0000
parent 4356:ab2e15d3f1fa
child 4694:6c57b9e31586
comparison
equal deleted inserted replaced
4514:81d0748bff5b 4515:2e33eeafe962
72 muc_marker_map_store:set(event.occupant.bare_jid, event.room.jid, marker.attr.id); 72 muc_marker_map_store:set(event.occupant.bare_jid, event.room.jid, marker.attr.id);
73 73
74 end); 74 end);
75 75
76 module:hook("muc-message-is-historic", function (event) 76 module:hook("muc-message-is-historic", function (event)
77 local marker = event.stanza:get_child(nil, xmlns_markers) 77 local marker = event.stanza:get_child(nil, xmlns_markers);
78 78
79 -- Prevent stanza from reaching the archive (it's just noise) 79 -- Prevent stanza from reaching the archive (it's just noise)
80 if marker and marker_element_names:contains(marker.name) then 80 if marker then
81 return false 81 return false;
82 end 82 end
83 end); 83 end);
84 84
85 local function find_nickname(room, user_jid) 85 local function find_nickname(room, user_jid)
86 -- Find their current nickname 86 -- Find their current nickname