diff mod_csi_battery_saver/mod_csi_battery_saver.lua @ 5892:433a4dd1dc2a

mod_csi_battery_saver: MDS headline pushes are important
author tmolitor <thilo@eightysoft.de>
date Mon, 29 Apr 2024 01:27:51 +0200
parents f6a2602129c8
children 5db53d619e66
line wrap: on
line diff
--- 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;