Changeset

10801:2b97aac0ea3c

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.
author Kim Alvefur <zash@zash.se>
date Tue, 05 May 2020 23:08:47 +0200
parents 10800:62794e065e33
children 10802:c11f9cd6c761
files plugins/mod_csi_simple.lua
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_csi_simple.lua	Tue May 05 22:21:39 2020 +0200
+++ b/plugins/mod_csi_simple.lua	Tue May 05 23:08:47 2020 +0200
@@ -28,18 +28,19 @@
 	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