diff options
author | Kim Alvefur <zash@zash.se> | 2021-01-12 17:00:27 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-01-12 17:00:27 +0100 |
commit | 7a4f8adb703ed93d1b0250ed6f9a72515efd49af (patch) | |
tree | d106e3beb931df0b48388f2a7e304046c6830631 /plugins/mod_storage_internal.lua | |
parent | fbea532698257057a612b5e868e4aec7b5b0b089 (diff) | |
download | prosody-7a4f8adb703ed93d1b0250ed6f9a72515efd49af.tar.gz prosody-7a4f8adb703ed93d1b0250ed6f9a72515efd49af.zip |
mod_storage_internal: Add support for full ID range query
Based on the mod_storage_memory implementation
Diffstat (limited to 'plugins/mod_storage_internal.lua')
-rw-r--r-- | plugins/mod_storage_internal.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua index 28dc8921..3b14fbaa 100644 --- a/plugins/mod_storage_internal.lua +++ b/plugins/mod_storage_internal.lua @@ -52,6 +52,7 @@ archive.caps = { total = true; quota = archive_item_limit; truncate = true; + full_id_range = true; }; function archive:append(username, key, value, when, with) @@ -178,8 +179,7 @@ function archive:find(username, query) return nil, "item-not-found"; end end - elseif query.before then - last_key = query.before; + last_key = query.after; elseif query.after then local found = false; for j = 1, #items do @@ -192,6 +192,9 @@ function archive:find(username, query) if not found then return nil, "item-not-found"; end + last_key = query.before; + elseif query.before then + last_key = query.before; end if query.limit and #items - i > query.limit then items[i+query.limit+1] = nil; |