mod_csi_battery_saver: MDS headline pushes are important
authortmolitor <thilo@eightysoft.de>
Mon, 29 Apr 2024 01:27:51 +0200
changeset 5896 433a4dd1dc2a
parent 5895 512f912fdfa5
child 5897 5db53d619e66
mod_csi_battery_saver: MDS headline pushes are important
mod_csi_battery_saver/mod_csi_battery_saver.lua
--- a/mod_csi_battery_saver/mod_csi_battery_saver.lua	Wed Apr 24 13:47:48 2024 +0100
+++ b/mod_csi_battery_saver/mod_csi_battery_saver.lua	Mon Apr 29 01:27:51 2024 +0200
@@ -104,8 +104,12 @@
 
 		local st_type = stanza.attr.type;
 
-		-- headline message are always not important
-		if st_type == "headline" then return false; end
+		-- headline message are always not important, with some exceptions
+		if st_type == "headline" then
+			-- allow headline pushes of mds updates
+			if stanza:find("{http://jabber.org/protocol/pubsub#event}event/items@node") == "urn:xmpp:mds:displayed:0" then return true; end;
+			return false
+		end
 
 		-- chat markers (XEP-0333) are important, too, because some clients use them to update their notifications
 		if stanza:child_with_ns("urn:xmpp:chat-markers:0") then return true; end;