mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
mod_component: Set module status to indicate whether component is connected
This commit is contained in:
parent
d89b760be1
commit
c6efcf09be
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue