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 | 091c29280a511aa2707fc27f9fcb24783bfbc255 (patch) | |
tree | d86ce85dce4f50741575eac948c0f4e67934818b | |
parent | 40c2d9048103e0b42d60a87d763cf7826e217a62 (diff) | |
download | prosody-091c29280a511aa2707fc27f9fcb24783bfbc255.tar.gz prosody-091c29280a511aa2707fc27f9fcb24783bfbc255.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 |