aboutsummaryrefslogtreecommitdiffstats
path: root/core/usermanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-08-25 01:20:13 +0200
committerKim Alvefur <zash@zash.se>2012-08-25 01:20:13 +0200
commit9059e2a4fe09ec771bc94d46e566b665dc8f1986 (patch)
tree16616afb502820096e33b40cf74327b38cc462bb /core/usermanager.lua
parentdf886d20430974d5d2a8829d76193f723734c88c (diff)
downloadprosody-9059e2a4fe09ec771bc94d46e566b665dc8f1986.tar.gz
prosody-9059e2a4fe09ec771bc94d46e566b665dc8f1986.zip
core.usermanager: Don't close sessions ourselves when deleting users. Instead, fire an event that modules can hook.
Diffstat (limited to 'core/usermanager.lua')
-rw-r--r--core/usermanager.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua
index efc15b7c..2ca0aef1 100644
--- a/core/usermanager.lua
+++ b/core/usermanager.lua
@@ -90,14 +90,9 @@ function create_user(username, password, host)
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