From 3d53bcd72ad31590009a48a6ebba9522f43ab689 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/mod_csi_simple.lua') 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 6b0baf8932c6b218e41612a2b773d84c56a4e633 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/mod_csi_simple.lua') 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 14787cf7ec6ccd1100b57292811938c5549199be 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/mod_csi_simple.lua') 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 7c10b606cdc86f534d6529a2fe52d9bdb7ba9100 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/mod_csi_simple.lua') 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 3b8d96984acfd884620fd6549689b5ff419108fe 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/mod_csi_simple.lua') 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