mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
PubSub: Support 'max_items=max' node configuration
Let clients request the maximum limit for the node configuration option 'max_items' by specifying the special value 'max' instead of an integer. This was added to XEP-0060, revision 1.17.0 (and clarified in revision 1.20.0). Thanks to Ammonit Measurement GmbH for sponsoring this work.
This commit is contained in:
parent
8afc320aba
commit
8f8de0403b
2
mix.exs
2
mix.exs
@ -124,7 +124,7 @@ defmodule Ejabberd.MixProject do
|
||||
{:pkix, "~> 1.0"},
|
||||
{:stringprep, ">= 1.0.26"},
|
||||
{:stun, "~> 1.0"},
|
||||
{:xmpp, "~> 1.5"},
|
||||
{:xmpp, git: "https://github.com/processone/xmpp", ref: "e943c0285aa85e3cbd4bfb9259f6b7de32b00395", override: true},
|
||||
{:yconf, "~> 1.0"}]
|
||||
++ cond_deps()
|
||||
end
|
||||
|
@ -59,7 +59,7 @@
|
||||
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.27"}}},
|
||||
{if_var_true, stun,
|
||||
{stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.44"}}}},
|
||||
{xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.5.4"}}},
|
||||
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "e943c0285aa85e3cbd4bfb9259f6b7de32b00395"}},
|
||||
{yconf, ".*", {git, "https://github.com/processone/yconf", {tag, "1.0.12"}}}
|
||||
]}.
|
||||
|
||||
|
@ -3553,8 +3553,10 @@ decode_get_pending(#xdata{fields = Fs}, Lang) ->
|
||||
check_opt_range(_Opt, _Opts, undefined) ->
|
||||
true;
|
||||
check_opt_range(Opt, Opts, Max) ->
|
||||
Val = proplists:get_value(Opt, Opts, Max),
|
||||
Val =< Max.
|
||||
case proplists:get_value(Opt, Opts, Max) of
|
||||
max -> true;
|
||||
Val -> Val =< Max
|
||||
end.
|
||||
|
||||
-spec get_max_items_node(host()) -> undefined | non_neg_integer().
|
||||
get_max_items_node(Host) ->
|
||||
@ -3708,6 +3710,7 @@ features() ->
|
||||
<<"access-whitelist">>, % OPTIONAL
|
||||
<<"collections">>, % RECOMMENDED
|
||||
<<"config-node">>, % RECOMMENDED
|
||||
<<"config-node-max">>,
|
||||
<<"create-and-configure">>, % RECOMMENDED
|
||||
<<"item-ids">>, % RECOMMENDED
|
||||
<<"last-published">>, % RECOMMENDED
|
||||
|
Loading…
Reference in New Issue
Block a user