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

mod_pubsub: Fix default node config parsing

Don't merge 'default_node_config' settings with the default options of
the first configured node plugin.  Otherwise, the latter might later
override those of the plugin that should handle a node creation request.
For example, the following configuration would lead to the 'flat'
options being used by default for 'pep' nodes as well:

  mod_pubsub:
    plugins:
      - flat
      - pep
This commit is contained in:
Holger Weiss 2024-09-28 16:45:59 +02:00
parent 4a931b42ab
commit b4399291ef

View File

@ -265,10 +265,7 @@ init([ServerHost|_]) ->
ejabberd_router:register_route(
Host, ServerHost, {apply, ?MODULE, route}),
{Plugins, NodeTree, PepMapping} = init_plugins(Host, ServerHost, Opts),
DefaultModule = plugin(Host, hd(Plugins)),
DefaultNodeCfg = merge_config(
[mod_pubsub_opt:default_node_config(Opts),
DefaultModule:options()]),
DefaultNodeCfg = mod_pubsub_opt:default_node_config(Opts),
lists:foreach(
fun(H) ->
T = gen_mod:get_module_proc(H, config),