# HG changeset patch # User Kim Alvefur # Date 1345850843 -7200 # Node ID 50a64fd79c0798dc51637e6a75d9d2e798602641 # Parent dddbcd62183a39dbdbb0599e1cca4e9f8f4260ed mod_register: Remove all account cleanup diff -r dddbcd62183a -r 50a64fd79c07 plugins/mod_register.lua --- a/plugins/mod_register.lua Sat Aug 25 01:21:41 2012 +0200 +++ b/plugins/mod_register.lua Sat Aug 25 01:27:23 2012 +0200 @@ -95,7 +95,6 @@ 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 , delete all user data local username, host = session.username, session.host; local ok, err = usermanager_delete_user(username, host); @@ -107,28 +106,6 @@ 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