diff mod_muc_markers/mod_muc_markers.lua @ 4024:95882b487ed2

mod_muc_markers: Allow configuration of which marker to track, default to displayed
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 May 2020 14:06:42 +0100
parents 45c5603a6c07
children 57b4cdeba318
line wrap: on
line diff
--- a/mod_muc_markers/mod_muc_markers.lua	Sun May 17 22:38:55 2020 +0200
+++ b/mod_muc_markers/mod_muc_markers.lua	Tue May 19 14:06:42 2020 +0100
@@ -10,6 +10,8 @@
 
 local xmlns_markers = "urn:xmpp:chat-markers:0";
 
+local marker_element_name = module:get_option_string("muc_marker_type", "displayed");
+
 local muc_marker_map_store = module:open_store("muc_markers", "map");
 
 local function get_stanza_id(stanza, by_jid)
@@ -35,7 +37,7 @@
 end, -1);
 
 module:hook("muc-occupant-groupchat", function (event)
-	local marker = event.stanza:get_child("received", xmlns_markers);
+	local marker = event.stanza:get_child(marker_element_name, xmlns_markers);
 	if not marker then return; end
 
 	-- Store the id that the user has received to