aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-10-20 17:32:34 +0200
committerKim Alvefur <zash@zash.se>2021-10-20 17:32:34 +0200
commit5016e666403899202ad8b5775761325ee98cf3b8 (patch)
tree3501ad5624c12e623e68f47c824b366655cbf3bd /plugins/mod_pep.lua
parent8b769c373d076ea0a678680ef187f83cd0e7d19d (diff)
downloadprosody-5016e666403899202ad8b5775761325ee98cf3b8.tar.gz
prosody-5016e666403899202ad8b5775761325ee98cf3b8.zip
mod_pubsub,mod_pep: Advertise maximum number of items via XEP-0122
Clients would generally be using the "max" symbol instead of discovering this, but this also gets us validation and earlier rejection of out of bounds values.
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r--plugins/mod_pep.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 93342e09..ad69e6ad 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -41,6 +41,13 @@ local function tonumber_max_items(n)
return tonumber(n);
end
+for _, field in ipairs(lib_pubsub.node_config_form) do
+ if field.var == "pubsub#max_items" then
+ field.range_max = max_max_items;
+ break;
+ end
+end
+
function module.save()
return {
services = services;