aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_csi_simple.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-05 23:08:47 +0200
committerKim Alvefur <zash@zash.se>2020-05-05 23:08:47 +0200
commit9339ebb8e37a72fae02bd5d928f7ce22beff1a80 (patch)
tree43dc06f0931667d4f3c4b3d98e2729d7b9eaacf6 /plugins/mod_csi_simple.lua
parentd146cc6f582196d9d9a79b6d3c2bf030cc26f7b2 (diff)
downloadprosody-9339ebb8e37a72fae02bd5d928f7ce22beff1a80.tar.gz
prosody-9339ebb8e37a72fae02bd5d928f7ce22beff1a80.zip
mod_csi_simple: Don't consider presence errors as important
A large share of `<presence type=error>` appears to be noise from large public channels and failed presence probes. The later at least should count as presence updates, which are currently considered unimportant. See also 8cecb85e4bc4 which is partly reverted here. The intent there was probably mostly about message (delivery) errors, which should be considered important.
Diffstat (limited to 'plugins/mod_csi_simple.lua')
-rw-r--r--plugins/mod_csi_simple.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index d3bf3a9f..05650957 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -28,18 +28,19 @@ module:hook("csi-is-stanza-important", function (event)
local st_name = stanza.name;
if not st_name then return false; end
local st_type = stanza.attr.type;
- if st_type == "error" then
- return true;
- end
if st_name == "presence" then
- if st_type == nil or st_type == "unavailable" then
+ if st_type == nil or st_type == "unavailable" or st_name == "error" then
return false;
end
+ -- TODO Some MUC awareness, e.g. check for the 'this relates to you' status code
return true;
elseif st_name == "message" then
if st_type == "headline" then
return false;
end
+ if st_type == "error" then
+ return true;
+ end
if stanza:get_child("sent", "urn:xmpp:carbons:2") then
return true;
end