# HG changeset patch # User JC Brand # Date 1610716021 -3600 # Node ID 83f89ffe427bcda20811f9becc10f2a382197fc9 # Parent 6872e55cfb92a6242951e78dc6b01f52b821f5cb mod_muc_markers: Add config setting to turn off sending of markers on MUC join diff -r 6872e55cfb92 -r 83f89ffe427b mod_muc_markers/README.markdown --- a/mod_muc_markers/README.markdown Wed Jan 13 16:50:47 2021 +0000 +++ b/mod_muc_markers/README.markdown Fri Jan 15 14:07:01 2021 +0100 @@ -26,9 +26,11 @@ ## Settings -| Name | Description | Default | -|-----------------|--------------------------------------------------------------|------------| -| muc_marker_type | The type of marker to track (displayed/received/acknowledged)| "displayed"| +| Name | Description | Default | +|----------------------------|--------------------------------------------------------------------------------------|-------------| +| muc_marker_summary_on_join | Whether a summary of all the latest markers should be sent to someone entering a MUC | "displayed" | +| muc_marker_type | The type of marker to track (displayed/received/acknowledged) | "displayed" | + # Developers diff -r 6872e55cfb92 -r 83f89ffe427b mod_muc_markers/mod_muc_markers.lua --- 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