# HG changeset patch # User Kim Alvefur # Date 1610467227 -3600 # Node ID b8fada57faf01cfcdfab1b3655bf57fa78ccebdc # Parent ecbfde40236491c01cf84138f4937dfcc9351331 mod_storage_internal: Add support for full ID range query Based on the mod_storage_memory implementation diff -r ecbfde402364 -r b8fada57faf0 plugins/mod_storage_internal.lua --- a/plugins/mod_storage_internal.lua Tue Jan 12 16:58:10 2021 +0100 +++ b/plugins/mod_storage_internal.lua Tue Jan 12 17:00:27 2021 +0100 @@ -52,6 +52,7 @@ total = true; quota = archive_item_limit; truncate = true; + full_id_range = true; }; function archive:append(username, key, value, when, with) @@ -178,8 +179,7 @@ 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 @@ 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;