diff options
author | Kim Alvefur <zash@zash.se> | 2020-04-18 16:18:41 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-04-18 16:18:41 +0200 |
commit | 4b33a7aac8b77777c3a59e94b2f82d365e421877 (patch) | |
tree | b1f098e71debb2a8bc79f4346c57ddf37e6af5a7 | |
parent | 44ed7a0e21e7c4a3380cb97be671f12a4b40f8d5 (diff) | |
download | prosody-4b33a7aac8b77777c3a59e94b2f82d365e421877.tar.gz prosody-4b33a7aac8b77777c3a59e94b2f82d365e421877.zip |
mod_csi_simple: Allow configuring extra tags indicating importance
-rw-r--r-- | plugins/mod_csi_simple.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index 4a87f06c..e439bf38 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -1,4 +1,4 @@ --- Copyright (C) 2016-2018 Kim Alvefur +-- Copyright (C) 2016-2020 Kim Alvefur -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. @@ -13,6 +13,8 @@ local filters = require "util.filters"; local queue_size = module:get_option_number("csi_queue_size", 256); +local important_payloads = module:get_option_set("csi_important_payloads", { }); + module:hook("csi-is-stanza-important", function (event) local stanza = event.stanza; if not st.is_stanza(stanza) then @@ -46,6 +48,11 @@ module:hook("csi-is-stanza-important", function (event) if stanza:get_child("encryption", "urn:xmpp:eme:0") then return true; end + for important in important_payloads do + if stanza:find(important) then + return true; + end + end return false; end return true; |