plugins/mod_storage_sql.lua
changeset 5040 685403a6fee1
parent 5035 874cab7b4b3e
child 5054 97385c45e670
--- a/plugins/mod_storage_sql.lua	Sat Jul 28 21:36:36 2012 +0200
+++ b/plugins/mod_storage_sql.lua	Sat Jul 28 21:36:42 2012 +0200
@@ -370,4 +370,12 @@
 	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);