aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_internal.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-15 21:22:35 +0200
committerKim Alvefur <zash@zash.se>2020-05-15 21:22:35 +0200
commitf62650ffab2ee68ba037bd1a02c57890c6ebb78d (patch)
tree46c097f1ab7201080d420bd2e13cdd28f44d6add /plugins/mod_storage_internal.lua
parent9a35d506e24a7441b59abfcbc25d1e7f85b3b1d9 (diff)
downloadprosody-f62650ffab2ee68ba037bd1a02c57890c6ebb78d.tar.gz
prosody-f62650ffab2ee68ba037bd1a02c57890c6ebb78d.zip
mod_storage_internal: Fix error in time limited queries on items without 'when' field, fixes #1557
Diffstat (limited to 'plugins/mod_storage_internal.lua')
-rw-r--r--plugins/mod_storage_internal.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua
index 42b451bd..0becfc8f 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -104,12 +104,14 @@ function archive:find(username, query)
end
if query.start then
items:filter(function (item)
- return item.when >= query.start;
+ local when = item.when or datetime.parse(item.attr.stamp);
+ return when >= query.start;
end);
end
if query["end"] then
items:filter(function (item)
- return item.when <= query["end"];
+ local when = item.when or datetime.parse(item.attr.stamp);
+ return when <= query["end"];
end);
end
count = #items;