diff options
author | Kim Alvefur <zash@zash.se> | 2022-02-06 14:34:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-02-06 14:34:02 +0100 |
commit | fd5a0f6a063677e35863589ad6980e1178d38746 (patch) | |
tree | a2f07865550ec888c5ac06543e616f61cb13eeb1 | |
parent | d274fa9a7e5f7f5e4b86c9b5671c1cc795f7049d (diff) | |
download | prosody-fd5a0f6a063677e35863589ad6980e1178d38746.tar.gz prosody-fd5a0f6a063677e35863589ad6980e1178d38746.zip |
mod_admin_shell: Track connected events instead of created
The connection events are more appropriate here, where the s2s-created
events happens a bit later or earlier in a sessions lifetime depending
on its direction and for outgoing connections isn't actually the
creation time (which happens immediately after pressing enter, so not
very interesting), but rather closer to the connection time.
-rw-r--r-- | plugins/mod_admin_shell.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 13ab213f..a8da5c09 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1482,17 +1482,17 @@ function def_env.xmpp:ping(localhost, remotehost, timeout) end end end - local oncreated = onchange("created"); + local onconnected = onchange("connected"); local onauthenticated = onchange("authenticated"); local onestablished = onchange("established"); local ondestroyed = onchange("destroyed"); - module:hook("s2s-created", oncreated, 1); + module:hook("s2s-connected", onconnected, 1); module:context(localhost):hook("s2s-authenticated", onauthenticated, 1); module:hook("s2sout-established", onestablished, 1); module:hook("s2sin-established", onestablished, 1); module:hook("s2s-destroyed", ondestroyed, 1); return module:context(localhost):send_iq(iq, nil, timeout):finally(function() - module:unhook("s2s-created", oncreated); + module:unhook("s2s-connected", onconnected, 1); module:context(localhost):unhook("s2s-authenticated", onauthenticated); module:unhook("s2sout-established", onestablished); module:unhook("s2sin-established", onestablished); |