From c604bdb897974d743f08577d76d5800c76ee2d90 Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Thu, 24 Oct 2019 14:59:47 +0300 Subject: 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. --- src/mod_pubsub_opt.erl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mod_pubsub_opt.erl') 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); -- cgit v1.2.3