diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-23 17:09:48 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-23 17:09:48 +0100 |
commit | 7c3ba237b9d0f3eb829b90e9e9344e5790481de3 (patch) | |
tree | f4cb4ff11dafef302e296a1f49425d766f11a973 /plugins | |
parent | aa5d88fe4437d08b509164568150bafc16222ce5 (diff) | |
download | prosody-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.lua | 9 |
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); |