diff options
author | Kim Alvefur <zash@zash.se> | 2012-08-25 01:27:23 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-08-25 01:27:23 +0200 |
commit | 8160ca4fc90592637e31c76fa700016d46636abd (patch) | |
tree | d86ce85dce4f50741575eac948c0f4e67934818b | |
parent | ccb65a89715175ff75f01e8e2b5508f4c56dbf23 (diff) | |
download | prosody-8160ca4fc90592637e31c76fa700016d46636abd.tar.gz prosody-8160ca4fc90592637e31c76fa700016d46636abd.zip |
mod_register: Remove all account cleanup
-rw-r--r-- | plugins/mod_register.lua | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 6c690c3b..a621b9a9 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -95,7 +95,6 @@ local function handle_registration_stanza(event) session.send(reply); else -- stanza.attr.type == "set" if query.tags[1] and query.tags[1].name == "remove" then - -- TODO delete user auth data, send iq response, kick all user resources with a <not-authorized/>, delete all user data local username, host = session.username, session.host; local ok, err = usermanager_delete_user(username, host); @@ -107,28 +106,6 @@ local function handle_registration_stanza(event) end session.send(st.reply(stanza)); - local roster = session.roster; - for _, session in pairs(hosts[host].sessions[username].sessions) do -- disconnect all resources - session:close({condition = "not-authorized", text = "Account deleted"}); - end - -- TODO datamanager should be able to delete all user data itself - datamanager.store(username, host, "vcard", nil); - datamanager.store(username, host, "private", nil); - datamanager.store(username, host, "account_details", nil); - datamanager.list_store(username, host, "offline", nil); - local bare = username.."@"..host; - for jid, item in pairs(roster) do - if jid and jid ~= "pending" then - if item.subscription == "both" or item.subscription == "from" or (roster.pending and roster.pending[jid]) then - module:send(st.presence({type="unsubscribed", from=bare, to=jid})); - end - if item.subscription == "both" or item.subscription == "to" or item.ask then - module:send(st.presence({type="unsubscribe", from=bare, to=jid})); - end - end - end - datamanager.store(username, host, "roster", nil); - datamanager.store(username, host, "privacy", nil); module:log("info", "User removed their account: %s@%s", username, host); module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session }); else |