--- a/plugins/mod_pubsub/pubsub.lib.lua Fri Sep 18 12:18:51 2020 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua Wed Jun 09 15:58:49 2021 +0200
@@ -83,7 +83,7 @@
};
{
type = "text-single";
- datatype = "xs:integer";
+ datatype = "pubsub:integer-or-max";
name = "max_items";
var = "pubsub#max_items";
label = "Max # of items to persist";
@@ -801,10 +801,9 @@
return item;
end
-local function archive_itemstore(archive, config, user, node)
- module:log("debug", "Creation of archive itemstore for node %s with config %q", node, config);
+local function archive_itemstore(archive, max_items, user, node)
+ module:log("debug", "Creation of archive itemstore for node %s with limit %d", node, max_items);
local get_set = {};
- local max_items = config["max_items"];
function get_set:items() -- luacheck: ignore 212/self
local data, err = archive:find(user, {
limit = tonumber(max_items);