projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f54e43a
)
mod_storage_sql2: archive:delete() with username = true deletes for all users
author
Kim Alvefur
<zash@zash.se>
Sun, 9 Feb 2014 14:12:13 +0000
(15:12 +0100)
committer
Kim Alvefur
<zash@zash.se>
Sun, 9 Feb 2014 14:12:13 +0000
(15:12 +0100)
plugins/mod_storage_sql2.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_storage_sql2.lua
b/plugins/mod_storage_sql2.lua
index 90e9ead0c1b2308058961b52832788bc4ca405d2..7a2ec4a76e9fa307eec850adab21ee921f35220b 100644
(file)
--- 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 "));