aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_csi.lua
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
commit0e3cb510adbc4d6f09360e6929c0146b7a5b4378 (patch)
treef4cb4ff11dafef302e296a1f49425d766f11a973 /plugins/mod_csi.lua
parent5ce52878ab9bbcad78beba75bb0d2fcb5cfb3175 (diff)
downloadprosody-0e3cb510adbc4d6f09360e6929c0146b7a5b4378.tar.gz
prosody-0e3cb510adbc4d6f09360e6929c0146b7a5b4378.zip
mod_csi: Set module status based on whether a CSI handler module appears to be loaded
Diffstat (limited to 'plugins/mod_csi.lua')
-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);