Software /
code /
prosody
Diff
plugins/mod_storage_internal.lua @ 9105:e735c9865f42
mod_storage_internal: Only apply truncate if there are more items than requested
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 04 Aug 2018 15:44:38 +0200 |
parent | 8402:469afa02947b |
child | 9883:f76bd399267c |
child | 10843:8fcd46ee9bf5 |
line wrap: on
line diff
--- a/plugins/mod_storage_internal.lua Sat Aug 04 12:00:46 2018 +0100 +++ b/plugins/mod_storage_internal.lua Sat Aug 04 15:44:38 2018 +0200 @@ -191,7 +191,7 @@ 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 }