Software /
code /
prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 11768:aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 05 Sep 2021 16:43:41 +0200 |
parent | 11723:3ead0967e04d |
child | 11769:071715a18394 |
comparison
equal
deleted
inserted
replaced
11767:5610f7c5b261 | 11768:aa6ab07544c2 |
---|---|
321 | 321 |
322 if not node then | 322 if not node then |
323 origin.send(pubsub_error_reply(stanza, "nodeid-required")); | 323 origin.send(pubsub_error_reply(stanza, "nodeid-required")); |
324 return true; | 324 return true; |
325 end | 325 end |
326 local ok, results = service:get_items(node, stanza.attr.from, requested_items); | 326 local resultspec; -- TODO rsm.get() |
327 if items.attr.max_items then | |
328 resultspec = { max = tonumber(items.attr.max_items) }; | |
329 end | |
330 local ok, results = service:get_items(node, stanza.attr.from, requested_items, resultspec); | |
327 if not ok then | 331 if not ok then |
328 origin.send(pubsub_error_reply(stanza, results)); | 332 origin.send(pubsub_error_reply(stanza, results)); |
329 return true; | 333 return true; |
330 end | 334 end |
331 | 335 |