mod_csi: Set module status based on whether a CSI handler module appears to be loaded

This commit is contained in:
Kim Alvefur 2019-11-23 17:09:48 +01:00
parent aa5d88fe44
commit 7c3ba237b9

View file

@ -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);