mod_muc_markers: Prevent any markers from reaching the archive, even if untracked
authorMatthew Wild <mwild1@gmail.com>
Mon, 22 Mar 2021 15:55:02 +0000
changeset 4519 2e33eeafe962
parent 4518 81d0748bff5b
child 4520 5bc706c2db8f
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.
mod_muc_markers/mod_muc_markers.lua
--- a/mod_muc_markers/mod_muc_markers.lua	Sun Mar 21 00:31:53 2021 +0100
+++ b/mod_muc_markers/mod_muc_markers.lua	Mon Mar 22 15:55:02 2021 +0000
@@ -74,11 +74,11 @@
 end);
 
 module:hook("muc-message-is-historic", function (event)
-	local marker = event.stanza:get_child(nil, xmlns_markers)
+	local marker = event.stanza:get_child(nil, xmlns_markers);
 
 	-- Prevent stanza from reaching the archive (it's just noise)
-	if marker and marker_element_names:contains(marker.name) then
-		return false
+	if marker then
+		return false;
 	end
 end);