Diff

mod_muc_markers/mod_muc_markers.lua @ 4337:83f89ffe427b

mod_muc_markers: Add config setting to turn off sending of markers on MUC join
author JC Brand <jc@opkode.com>
date Fri, 15 Jan 2021 14:07:01 +0100
parent 4298:020dd0a59f1f
child 4356:ab2e15d3f1fa
line wrap: on
line diff
--- a/mod_muc_markers/mod_muc_markers.lua	Wed Jan 13 16:50:47 2021 +0000
+++ b/mod_muc_markers/mod_muc_markers.lua	Fri Jan 15 14:07:01 2021 +0100
@@ -21,6 +21,7 @@
 end
 
 local marker_element_name = module:get_option_string("muc_marker_type", "displayed");
+local marker_summary_on_join = module:get_option_string("muc_marker_summary_on_join", true);
 local rewrite_id_attribute = module:get_option_boolean("muc_marker_rewrite_id", false);
 
 assert(marker_order[marker_element_name], "invalid marker name: "..marker_element_name);
@@ -96,6 +97,9 @@
 -- Synthesize markers
 if muc_marker_map_store.get_all then
 module:hook("muc-occupant-session-new", function (event)
+	if  not marker_summary_on_join then
+		return;
+	end
 	local room, to = event.room, event.stanza.attr.from;
 	local markers = muc_marker_map_store:get_all(room.jid);
 	if not markers then return end