# HG changeset patch # User Kim Alvefur # Date 1574525388 -3600 # Node ID 12a10208d86a0f7242deabb8517cabfe16e4ad32 # Parent 35bc8d495569bc5570e2a2c09c1a5e5199aa5f8c mod_csi: Set module status based on whether a CSI handler module appears to be loaded diff -r 35bc8d495569 -r 12a10208d86a plugins/mod_csi.lua --- a/plugins/mod_csi.lua Sun Nov 17 23:53:51 2019 +0100 +++ b/plugins/mod_csi.lua Sat Nov 23 17:09:48 2019 +0100 @@ -21,3 +21,12 @@ 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);