aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pubsub_opt.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-10-24 14:59:47 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-10-24 14:59:47 +0300
commitc604bdb897974d743f08577d76d5800c76ee2d90 (patch)
tree795f2b4f8ca1722f5b005aa86e53951401e8161f /src/mod_pubsub_opt.erl
parentFix logger initialization on OTP<21.3 (diff)
Limit result set of disco#items for mod_pubsub
The size of a list of nodes returned for disco#items request is now controlled by option 'max_nodes_discoitems'. The default value is 100. The name and the default value of the option is chosen to be consistent with mod_muc's 'max_rooms_discoitems' option.
Diffstat (limited to 'src/mod_pubsub_opt.erl')
-rw-r--r--src/mod_pubsub_opt.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mod_pubsub_opt.erl b/src/mod_pubsub_opt.erl
index 68ed7f960..8db5532f6 100644
--- a/src/mod_pubsub_opt.erl
+++ b/src/mod_pubsub_opt.erl
@@ -12,6 +12,7 @@
-export([ignore_pep_from_offline/1]).
-export([last_item_cache/1]).
-export([max_items_node/1]).
+-export([max_nodes_discoitems/1]).
-export([max_subscriptions_node/1]).
-export([name/1]).
-export([nodetree/1]).
@@ -73,6 +74,12 @@ max_items_node(Opts) when is_map(Opts) ->
max_items_node(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, max_items_node).
+-spec max_nodes_discoitems(gen_mod:opts() | global | binary()) -> 'infinity' | non_neg_integer().
+max_nodes_discoitems(Opts) when is_map(Opts) ->
+ gen_mod:get_opt(max_nodes_discoitems, Opts);
+max_nodes_discoitems(Host) ->
+ gen_mod:get_module_opt(Host, mod_pubsub, max_nodes_discoitems).
+
-spec max_subscriptions_node(gen_mod:opts() | global | binary()) -> 'undefined' | non_neg_integer().
max_subscriptions_node(Opts) when is_map(Opts) ->
gen_mod:get_opt(max_subscriptions_node, Opts);