# HG changeset patch # User Kim Alvefur # Date 1345850413 -7200 # Node ID e646c849d72f5841af19d5b63a30d0ea301642e5 # Parent 1ce9e8068ddaf2b40edd8a53a441d75e3029a7b1 core.usermanager: Don't close sessions ourselves when deleting users. Instead, fire an event that modules can hook. diff -r 1ce9e8068dda -r e646c849d72f core/usermanager.lua --- a/core/usermanager.lua Tue Aug 21 21:10:54 2012 +0200 +++ b/core/usermanager.lua Sat Aug 25 01:20:13 2012 +0200 @@ -90,14 +90,9 @@ end function delete_user(username, 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 local ok, err = hosts[host].users.delete_user(username); if not ok then return nil, err; end + prosody.events.fire_event("user-deleted", { username = username, host = host }); return storagemanager.get_driver(host):purge(username); end