aboutsummaryrefslogtreecommitdiffstats
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
commit8bf181b4fc4b21d41df98b31c8b606a7232d26be (patch)
tree16616afb502820096e33b40cf74327b38cc462bb
parentd2867a450744154590980748a09b92d8fb96c0eb (diff)
downloadprosody-8bf181b4fc4b21d41df98b31c8b606a7232d26be.tar.gz
prosody-8bf181b4fc4b21d41df98b31c8b606a7232d26be.zip
core.usermanager: Don't close sessions ourselves when deleting users. Instead, fire an event that modules can hook.
-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