Mercurial > prosody-hg
diff plugins/mod_pubsub/pubsub.lib.lua @ 11631:6641ca266d94
mod_pubsub,mod_pep: Support "max" as 'pubsub#max_items'
Fixes #1643
API change: The argument to archive_itemstore() changes type to integer
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 09 Jun 2021 15:58:49 +0200 |
| parents | ef623d719894 |
| children | d783716103c1 |
line wrap: on
line diff
--- 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);
