# HG changeset patch # User Michel Le Bihan # Date 1521841126 -3600 # Node ID dfac28504e863cfaa75d94a04466838e2efa41e7 # Parent ec7f9c8f2a5fc7962c734bfc1ad2b8ac44331d4c mod_csi_battery_saver: Remove whitespace only lines diff -r ec7f9c8f2a5f -r dfac28504e86 mod_csi_battery_saver/mod_csi_battery_saver.lua --- a/mod_csi_battery_saver/mod_csi_battery_saver.lua Fri Mar 23 21:55:32 2018 +0100 +++ b/mod_csi_battery_saver/mod_csi_battery_saver.lua Fri Mar 23 22:38:46 2018 +0100 @@ -116,28 +116,28 @@ --session.log("debug", "mod_csi_battery_saver(%s): stanza_direction = %s, carbon = %s, stanza = %s", id, stanza_direction, carbon and "true" or "false", tostring(stanza)); if carbon then stanza = carbon; end st_type = stanza.attr.type; - + -- headline message are always not important if st_type == "headline" then return false; end - + -- chat markers (XEP-0333) are important, too, because some clients use them to update their notifications if find(stanza, "{urn:xmpp:chat-markers:0}") then return true; end; - + -- carbon copied outgoing messages are important (some clients update their notifications upon receiving those) --> don't return false here --if carbon and stanza_direction == "out" then return false; end - + -- We can't check for body contents in encrypted messages, so let's treat them as important -- Some clients don't even set a body or an empty body for encrypted messages - + -- check omemo https://xmpp.org/extensions/inbox/omemo.html if stanza:get_child("encrypted", "eu.siacs.conversations.axolotl") or stanza:get_child("encrypted", "urn:xmpp:omemo:0") then return true; end - + -- check xep27 pgp https://xmpp.org/extensions/xep-0027.html if stanza:get_child("x", "jabber:x:encrypted") then return true; end - + -- check xep373 pgp (OX) https://xmpp.org/extensions/xep-0373.html if stanza:get_child("openpgp", "urn:xmpp:openpgp:0") then return true; end - + local body = stanza:get_child_text("body"); if st_type == "groupchat" then if stanza:get_child_text("subject") then return true; end