From 38c98346b185543fa9f79ab6120f997368662538 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 6 Jan 2019 21:03:09 +0100 Subject: mod_csi_simple: Tweak check for There were code that checked the body for mentions but isn't included. --- plugins/mod_csi_simple.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index 1efff38f..51644515 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -63,8 +63,10 @@ module:hook("csi-is-stanza-important", function (event) if st_type == "headline" then return false; end - local body = stanza:get_child_text("body"); - return body; + if stanza:get_child("body") then + return true; + end + return false; end return true; end, -1); -- cgit v1.2.3 From 9251fa5500802ec09344ac93d47636c2a9601c45 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 6 Jan 2019 21:08:11 +0100 Subject: mod_csi_simple: Consider messages forwarded from another of the users clients as important (fixes part of #1250) --- plugins/mod_csi_simple.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index 51644515..3f0560ca 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -63,6 +63,9 @@ module:hook("csi-is-stanza-important", function (event) if st_type == "headline" then return false; end + if stanza:get_child("sent", "urn:xmpp:carbons:2") then + return true; + end if stanza:get_child("body") then return true; end -- cgit v1.2.3 From 05b481ec89cf10d6ca94775afdb199c15f13c3b9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 6 Jan 2019 21:09:50 +0100 Subject: mod_csi_simple: Unpack Carbons-forwarded messages (fixes part of #1250) --- plugins/mod_csi_simple.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index 3f0560ca..cf03ef48 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -66,6 +66,10 @@ module:hook("csi-is-stanza-important", function (event) if stanza:get_child("sent", "urn:xmpp:carbons:2") then return true; end + local forwarded = stanza:find("{urn:xmpp:carbons:2}received/{urn:xmpp:forward:0}/{jabber:client}message"); + if forwarded then + stanza = forwarded; + end if stanza:get_child("body") then return true; end -- cgit v1.2.3 From e03098631f29c17d0ae3eb217d90cae1219f45ef Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 6 Jan 2019 21:09:00 +0100 Subject: mod_csi_simple: Consider messages with subject (eg MUC joins) (fixes part of #1250) --- plugins/mod_csi_simple.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index cf03ef48..da6f4913 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -73,6 +73,9 @@ module:hook("csi-is-stanza-important", function (event) if stanza:get_child("body") then return true; end + if stanza:get_child("subject") then + return true; + end return false; end return true; -- cgit v1.2.3 From 24c44a4566cca3fefd978a6668d20f750a813a8a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 6 Jan 2019 21:09:32 +0100 Subject: mod_csi_simple: Consider messages encrypted payload as important (fixes part of #1250) --- plugins/mod_csi_simple.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index da6f4913..da2dd953 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -76,6 +76,9 @@ module:hook("csi-is-stanza-important", function (event) if stanza:get_child("subject") then return true; end + if stanza:get_child("encryption", "urn:xmpp:eme:0") then + return true; + end return false; end return true; -- cgit v1.2.3