Software /
code /
prosody
Comparison
plugins/mod_c2s.lua @ 12677:3b9771d496ed
mod_smacks: Long overdue cleanup of resumption code, fixes some old TODOs
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 26 Aug 2022 17:04:15 +0100 |
parent | 12662:07424992d7fc |
child | 12773:f100c1035576 |
comparison
equal
deleted
inserted
replaced
12676:3ab3ef9584e3 | 12677:3b9771d496ed |
---|---|
259 end | 259 end |
260 | 260 |
261 module:hook_global("user-password-changed", disconnect_user_sessions({ condition = "reset", text = "Password changed" }, true), 200); | 261 module:hook_global("user-password-changed", disconnect_user_sessions({ condition = "reset", text = "Password changed" }, true), 200); |
262 module:hook_global("user-role-changed", disconnect_user_sessions({ condition = "reset", text = "Role changed" }), 200); | 262 module:hook_global("user-role-changed", disconnect_user_sessions({ condition = "reset", text = "Role changed" }), 200); |
263 module:hook_global("user-deleted", disconnect_user_sessions({ condition = "not-authorized", text = "Account deleted" }), 200); | 263 module:hook_global("user-deleted", disconnect_user_sessions({ condition = "not-authorized", text = "Account deleted" }), 200); |
264 | |
265 module:hook_global("c2s-session-updated", function (event) | |
266 sessions[event.session.conn] = event.session; | |
267 local replaced_conn = event.replaced_conn; | |
268 if replaced_conn then | |
269 sessions[replaced_conn] = nil; | |
270 end | |
271 end); | |
264 | 272 |
265 function runner_callbacks:ready() | 273 function runner_callbacks:ready() |
266 if self.data.conn then | 274 if self.data.conn then |
267 self.data.conn:resume(); | 275 self.data.conn:resume(); |
268 else | 276 else |