aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-23 17:09:48 +0100
committerKim Alvefur <zash@zash.se>2019-11-23 17:09:48 +0100
commit7c3ba237b9d0f3eb829b90e9e9344e5790481de3 (patch)
treef4cb4ff11dafef302e296a1f49425d766f11a973 /plugins
parentaa5d88fe4437d08b509164568150bafc16222ce5 (diff)
downloadprosody-7c3ba237b9d0f3eb829b90e9e9344e5790481de3.tar.gz
prosody-7c3ba237b9d0f3eb829b90e9e9344e5790481de3.zip
mod_csi: Set module status based on whether a CSI handler module appears to be loaded
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_csi.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_csi.lua b/plugins/mod_csi.lua
index 870df418..e84ee032 100644
--- a/plugins/mod_csi.lua
+++ b/plugins/mod_csi.lua
@@ -21,3 +21,12 @@ end
module:hook("stanza/"..xmlns_csi..":active", refire_event("csi-client-active"));
module:hook("stanza/"..xmlns_csi..":inactive", refire_event("csi-client-inactive"));
+function module.load()
+ if prosody.hosts[module.host].events._handlers["csi-client-active"] then
+ module:set_status("core", "CSI handler module loaded");
+ else
+ module:set_status("warn", "No CSI handler module loaded");
+ end
+end
+module:hook("module-loaded", module.load);
+module:hook("module-unloaded", module.load);