diff options
author | Matthew Wild <mwild1@gmail.com> | 2019-03-19 09:08:06 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2019-03-19 09:08:06 +0000 |
commit | c6efcf09bec3f89c768ebab216c69ce116b091e6 (patch) | |
tree | abde9bfcc2fcad543e465cfbfc7a29410de141f7 | |
parent | d89b760be1cc44c166a587b8b32b67536c92c9d9 (diff) | |
download | prosody-c6efcf09bec3f89c768ebab216c69ce116b091e6.tar.gz prosody-c6efcf09bec3f89c768ebab216c69ce116b091e6.zip |
mod_component: Set module status to indicate whether component is connected
-rw-r--r-- | plugins/mod_component.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index b8c87dee..b1ffc81d 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -49,6 +49,7 @@ function module.add_host(module) local send; local function on_destroy(session, err) --luacheck: ignore 212/err + module:set_status("warn", err and ("Disconnected: "..err) or "Disconnected"); env.connected = false; env.session = false; send = nil; @@ -102,6 +103,7 @@ function module.add_host(module) module:log("info", "External component successfully authenticated"); session.send(st.stanza("handshake")); module:fire_event("component-authenticated", { session = session }); + module:set_status("info", "Connected"); return true; end |