From b4399291efd86f06d2d2883f5fc2c66e9d39a27b Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 28 Sep 2024 16:45:59 +0200 Subject: [PATCH] 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 --- src/mod_pubsub.erl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 9fe4ce949..6e7e2e5fd 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -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),