aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-04 15:44:38 +0200
committerKim Alvefur <zash@zash.se>2018-08-04 15:44:38 +0200
commitad2d64f657914b8c3fecbc0c70d4652b6b215cf9 (patch)
tree5cbdb660e26be32a793bcd9c2d8f47808b86a7cf /plugins
parent671694c5e78a91d58d17e2f1255b01a0ae997fea (diff)
downloadprosody-ad2d64f657914b8c3fecbc0c70d4652b6b215cf9.tar.gz
prosody-ad2d64f657914b8c3fecbc0c70d4652b6b215cf9.zip
mod_storage_internal: Only apply truncate if there are more items than requested
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_internal.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua
index 27bd8830..42b451bd 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -191,7 +191,7 @@ function archive:delete(username, query)
return item.when > query["end"];
end);
end
- if query.truncate then
+ if query.truncate and #items > query.truncate then
if query.reverse then
-- Before: { 1, 2, 3, 4, 5, }
-- After: { 1, 2, 3 }