diff options
author | Kim Alvefur <zash@zash.se> | 2021-09-05 16:43:41 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-09-05 16:43:41 +0200 |
commit | 22060f15ccd6851e77dd0cd38efaecb91bd0d623 (patch) | |
tree | 5159b11b748795f780ee9556e48b5870291121aa /plugins | |
parent | 1546e59310f4eb2888227a0f09a4554cc7da145d (diff) | |
download | prosody-22060f15ccd6851e77dd0cd38efaecb91bd0d623.tar.gz prosody-22060f15ccd6851e77dd0cd38efaecb91bd0d623.zip |
mod_pubsub: Add support for limiting result size #1608
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_pubsub/pubsub.lib.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index 3c38218a..92e210ca 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -323,7 +323,11 @@ function handlers.get_items(origin, stanza, items, service) origin.send(pubsub_error_reply(stanza, "nodeid-required")); return true; end - local ok, results = service:get_items(node, stanza.attr.from, requested_items); + local resultspec; -- TODO rsm.get() + if items.attr.max_items then + resultspec = { max = tonumber(items.attr.max_items) }; + end + local ok, results = service:get_items(node, stanza.attr.from, requested_items, resultspec); if not ok then origin.send(pubsub_error_reply(stanza, results)); return true; |