# HG changeset patch # User Kim Alvefur # Date 1644154442 -3600 # Node ID 9016071867d7a70a0abafc5c8c8031da12f283e8 # Parent 74f8739b967a431cc4bb080aee5a91cc317fba1f 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. diff -r 74f8739b967a -r 9016071867d7 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Sun Feb 06 14:31:27 2022 +0100 +++ b/plugins/mod_admin_shell.lua Sun Feb 06 14:34:02 2022 +0100 @@ -1482,17 +1482,17 @@ 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);