# HG changeset patch # User Kim Alvefur # Date 1391955133 -3600 # Node ID 918ab89cb68d323cf5ccd69fd1a6de30b20e358b # Parent 7e8a624272bfb2ec69712b2239a7862018ce481c mod_storage_sql2: archive:delete() with username = true deletes for all users diff -r 7e8a624272bf -r 918ab89cb68d plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Sun Feb 09 15:09:12 2014 +0100 +++ b/plugins/mod_storage_sql2.lua Sun Feb 09 15:12:13 2014 +0100 @@ -325,6 +325,10 @@ 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 "));