Skip to content

Commit

Permalink
mod_pubsub: Fix default node config parsing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
weiss committed Sep 28, 2024
1 parent 4a931b4 commit b439929
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/mod_pubsub.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit b439929

Please sign in to comment.