aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-30 15:24:17 +0100
committerKim Alvefur <zash@zash.se>2021-11-30 15:24:17 +0100
commit0d9065ae80cf76bd9b0042fb9d2f1ecfc9e06fc9 (patch)
tree5cd8bd4dfae9a89bc11d6b56ecedc3b3dd798558 /plugins/mod_storage_sql.lua
parent59258d47bd246ad55de5accf4331f44933a9755d (diff)
downloadprosody-0d9065ae80cf76bd9b0042fb9d2f1ecfc9e06fc9.tar.gz
prosody-0d9065ae80cf76bd9b0042fb9d2f1ecfc9e06fc9.zip
mod_storage_sql: Fix traceback on multi-user deletion
jid.join(true, ...) fails. Since we don't know which users this affects, best to clear the whole cache.
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index f034a0eb..deafb005 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -624,8 +624,12 @@ function archive_store:delete(username, query)
end
return engine:delete(sql_query, unpack(args));
end);
- local cache_key = jid_join(username, host, self.store);
- archive_item_count_cache:set(cache_key, nil);
+ if username == true then
+ archive_item_count_cache:clear();
+ else
+ local cache_key = jid_join(username, host, self.store);
+ archive_item_count_cache:set(cache_key, nil);
+ end
return ok and stmt:affected(), stmt;
end