Software /
code /
prosody
Comparison
plugins/mod_csi.lua @ 10428:12a10208d86a
mod_csi: Set module status based on whether a CSI handler module appears to be loaded
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 23 Nov 2019 17:09:48 +0100 |
parent | 10427:35bc8d495569 |
child | 10429:0b04d25c4ffb |
comparison
equal
deleted
inserted
replaced
10427:35bc8d495569 | 10428:12a10208d86a |
---|---|
19 end | 19 end |
20 | 20 |
21 module:hook("stanza/"..xmlns_csi..":active", refire_event("csi-client-active")); | 21 module:hook("stanza/"..xmlns_csi..":active", refire_event("csi-client-active")); |
22 module:hook("stanza/"..xmlns_csi..":inactive", refire_event("csi-client-inactive")); | 22 module:hook("stanza/"..xmlns_csi..":inactive", refire_event("csi-client-inactive")); |
23 | 23 |
24 function module.load() | |
25 if prosody.hosts[module.host].events._handlers["csi-client-active"] then | |
26 module:set_status("core", "CSI handler module loaded"); | |
27 else | |
28 module:set_status("warn", "No CSI handler module loaded"); | |
29 end | |
30 end | |
31 module:hook("module-loaded", module.load); | |
32 module:hook("module-unloaded", module.load); |