Changeset

5916: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 5915:512f912fdfa5
children 5917:5db53d619e66
files mod_csi_battery_saver/mod_csi_battery_saver.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
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;