Software /
code /
prosody
Diff
plugins/mod_storage_sql2.lua @ 6013:918ab89cb68d
mod_storage_sql2: archive:delete() with username = true deletes for all users
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Feb 2014 15:12:13 +0100 |
parent | 5996:e7efa9703a3f |
child | 6060:de4c83feb064 |
line wrap: on
line diff
--- 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 "));