diff options
author | Kim Alvefur <zash@zash.se> | 2022-02-06 14:31:27 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-02-06 14:31:27 +0100 |
commit | d274fa9a7e5f7f5e4b86c9b5671c1cc795f7049d (patch) | |
tree | 3c5482fbcce8357463c131bc8a75b685f918eeba /plugins/mod_s2s.lua | |
parent | 3c1c2064c6e53f36f1b354fdf30008f1e14cffd5 (diff) | |
download | prosody-d274fa9a7e5f7f5e4b86c9b5671c1cc795f7049d.tar.gz prosody-d274fa9a7e5f7f5e4b86c9b5671c1cc795f7049d.zip |
mod_s2s: Add new early s2s-connected events
Allows doing things based on connections rather than sessions, which may
have been created before or after.
Diffstat (limited to 'plugins/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index 579dfe86..3710a967 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -820,11 +820,14 @@ function listener.onconnect(conn) session = s2s_new_incoming(conn); sessions[conn] = session; session.log("debug", "Incoming s2s connection"); + module:fire_event("s2sin-connected", { session = session }) initialize_session(session); m_accepted_tcp_connections:with_labels():add(1) else -- Outgoing session connected + module:fire_event("s2sout-connected", { session = session }) session:open_stream(session.from_host, session.to_host); end + module:fire_event("s2s-connected", { session = session }) session.ip = conn:ip(); end |