Software /
code /
prosody
Changeset
5097:6c52a7a881cc
mod_c2s: When a user gets deleted, drop all their sessions
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 25 Aug 2012 01:28:38 +0200 |
parents | 5096:50a64fd79c07 |
children | 5098:fca8b5946f6f |
files | plugins/mod_c2s.lua |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_c2s.lua Sat Aug 25 01:27:23 2012 +0200 +++ b/plugins/mod_c2s.lua Sat Aug 25 01:28:38 2012 +0200 @@ -169,6 +169,16 @@ end end +module:hook_global("user-deleted", function(event) + local username, host = event.username, event.host; + local user = hosts[host].sessions[username]; + if user and user.sessions then + for jid, session in pairs(user.sessions) do + session:close{ condition = "not-authorized", text = "Account deleted" }; + end + end +end, 200); + --- Port listener function listener.onconnect(conn) local session = sm_new_session(conn);