diff options
author | Kim Alvefur <zash@zash.se> | 2014-02-09 15:12:13 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-02-09 15:12:13 +0100 |
commit | 481aefcb7192dfb83379df2fa92a317f95e81c72 (patch) | |
tree | 7afdbaf948663dbba8d3ee2f7b3c4c75449ba46e /plugins/mod_storage_sql2.lua | |
parent | a4f64d4c8b9d8df6774a9e319423c06109d8bfbf (diff) | |
download | prosody-481aefcb7192dfb83379df2fa92a317f95e81c72.tar.gz prosody-481aefcb7192dfb83379df2fa92a317f95e81c72.zip |
mod_storage_sql2: archive:delete() with username = true deletes for all users
Diffstat (limited to 'plugins/mod_storage_sql2.lua')
-rw-r--r-- | plugins/mod_storage_sql2.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua index 90e9ead0..7a2ec4a7 100644 --- a/plugins/mod_storage_sql2.lua +++ b/plugins/mod_storage_sql2.lua @@ -325,6 +325,10 @@ function archive_store:delete(username, query) local sql_query = "DELETE FROM `prosodyarchive` WHERE %s;"; local args = { host, user or "", store, }; local where = { "`host` = ?", "`user` = ?", "`store` = ?", }; + if user == true then + table.remove(args, 2); + table.remove(where, 2); + end archive_where(query, args, where); archive_where_id_range(query, args, where); sql_query = sql_query:format(t_concat(where, " AND ")); |