aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-07-28 21:36:42 +0200
committerKim Alvefur <zash@zash.se>2012-07-28 21:36:42 +0200
commite32e74aaae141499428959e2f6863cea87ee297a (patch)
tree64e33ef6e4b5bce61a10fe5626ff8396ceb066a8
parent989d976c85ac5ac50ad68f6fde158aee8fec13d0 (diff)
downloadprosody-e32e74aaae141499428959e2f6863cea87ee297a.tar.gz
prosody-e32e74aaae141499428959e2f6863cea87ee297a.zip
mod_storage_sql: Add method for removing all data belonging to a user
-rw-r--r--plugins/mod_storage_sql.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 211f4d5f..6d19eee6 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -370,4 +370,12 @@ function driver:list_stores(username) -- Not to be confused with the list store
return stores;
end
+function driver:purge(username)
+ local stmt, err = dosql("DELETE FROM `prosody` WHERE `host`=? AND `user`=?", host, username);
+ if not stmt then return stmt, err; end
+ local changed, err = stmt:affected();
+ if not changed then return changed, err; end
+ return true, changed;
+end
+
module:add_item("data-driver", driver);