diff options
author | Kim Alvefur <zash@zash.se> | 2021-01-12 16:58:10 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-01-12 16:58:10 +0100 |
commit | 7ed7be79570e832435a8d6c5ddec5ca4137eee96 (patch) | |
tree | e46043688152f04cd3f369a470e3233e53949cf7 | |
parent | ddd3fff2e97f76c56e9b0a61f23b2ff7b564d578 (diff) | |
download | prosody-7ed7be79570e832435a8d6c5ddec5ca4137eee96.tar.gz prosody-7ed7be79570e832435a8d6c5ddec5ca4137eee96.zip |
mod_storage_memory: Support full ID range queries
-rw-r--r-- | plugins/mod_storage_memory.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_storage_memory.lua b/plugins/mod_storage_memory.lua index d71dc0f0..1c960ead 100644 --- a/plugins/mod_storage_memory.lua +++ b/plugins/mod_storage_memory.lua @@ -57,6 +57,7 @@ archive_store.caps = { total = true; quota = archive_item_limit; truncate = true; + full_id_range = true; }; function archive_store:append(username, key, value, when, with) @@ -142,8 +143,7 @@ function archive_store: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 @@ -156,6 +156,9 @@ function archive_store: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; |