diff options
author | Matthew Wild <mwild1@gmail.com> | 2022-08-26 17:04:15 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2022-08-26 17:04:15 +0100 |
commit | 54fcc029c8fafd6e9fd9a38e279e5557177c1370 (patch) | |
tree | d80b23dbee76a881b01f051deb9690e5672bb602 /plugins/mod_c2s.lua | |
parent | 95bba786f1fb0e15b98fa2b475d0ad585ad359a3 (diff) | |
download | prosody-54fcc029c8fafd6e9fd9a38e279e5557177c1370.tar.gz prosody-54fcc029c8fafd6e9fd9a38e279e5557177c1370.zip |
mod_smacks: Long overdue cleanup of resumption code, fixes some old TODOs
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r-- | plugins/mod_c2s.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index e8241687..2d4186d0 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -262,6 +262,14 @@ module:hook_global("user-password-changed", disconnect_user_sessions({ condition module:hook_global("user-role-changed", disconnect_user_sessions({ condition = "reset", text = "Role changed" }), 200); module:hook_global("user-deleted", disconnect_user_sessions({ condition = "not-authorized", text = "Account deleted" }), 200); +module:hook_global("c2s-session-updated", function (event) + sessions[event.session.conn] = event.session; + local replaced_conn = event.replaced_conn; + if replaced_conn then + sessions[replaced_conn] = nil; + end +end); + function runner_callbacks:ready() if self.data.conn then self.data.conn:resume(); |