25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

mod_pubsub: Fix merging of default node options

Use any option specified via 'default_node_config' by default, and take
the remaining defaults from the node plugin handling the request.  This
is the documented behavior.

Before this change, the code applied the plugin defaults only if no
'default_node_config' existed at all.  And even this logic didn't work
as intended, since 'default_node_config' yielded an empty list in case
it wasn't configured, which resulted in plugin defaults never being
applied.
This commit is contained in:
Holger Weiss 2024-09-28 16:56:46 +02:00
parent b4399291ef
commit ca54f81f58

View File

@ -3367,9 +3367,10 @@ get_option(Options, Var, Def) ->
-spec node_options(host(), binary()) -> [{atom(), any()}]. -spec node_options(host(), binary()) -> [{atom(), any()}].
node_options(Host, Type) -> node_options(Host, Type) ->
DefaultOpts = node_plugin_options(Host, Type), DefaultOpts = node_plugin_options(Host, Type),
ConfigOpts = config(Host, default_node_config),
case lists:member(Type, config(Host, plugins)) of case lists:member(Type, config(Host, plugins)) of
true -> true ->
config(Host, default_node_config, DefaultOpts); merge_config([ConfigOpts, DefaultOpts]);
false -> DefaultOpts false -> DefaultOpts
end. end.