# HG changeset patch # User tmolitor # Date 1714346871 -7200 # Node ID 433a4dd1dc2abe8b0743731c4691c4a39c6ea6e0 # Parent 512f912fdfa5c6c52aaf77f6f5b49c8ee205ca67 mod_csi_battery_saver: MDS headline pushes are important diff -r 512f912fdfa5 -r 433a4dd1dc2a 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;