diff options
author | Kim Alvefur <zash@zash.se> | 2012-08-25 01:28:38 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-08-25 01:28:38 +0200 |
commit | 1e65e68cacacc39102f325cffb8bd5b8d7bad377 (patch) | |
tree | 447b17e5188671abdd6c4e1b9a6f3d3fb084da48 /plugins | |
parent | 091c29280a511aa2707fc27f9fcb24783bfbc255 (diff) | |
download | prosody-1e65e68cacacc39102f325cffb8bd5b8d7bad377.tar.gz prosody-1e65e68cacacc39102f325cffb8bd5b8d7bad377.zip |
mod_c2s: When a user gets deleted, drop all their sessions
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_c2s.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 2318ecad..e9b24f69 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -169,6 +169,16 @@ local function session_close(session, reason) 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); |