From c41c5b218542e040abb4284cbd2c355dc2aee892 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 6 Feb 2019 13:30:30 +0100 Subject: [PATCH] Fix support to restart module with live options in WebAdmin --- src/ejabberd_web_admin.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index 967af53ae..4c4501436 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -2381,10 +2381,13 @@ node_modules_parse_query(Host, Node, Modules, Query) -> {ok, Tokens, _} = erl_scan:string(binary_to_list(<>)), {ok, Opts} = erl_parse:parse_term(Tokens), + NewMods = lists:keystore(Module, 1, ejabberd_config:get_option(modules), {Module, Opts}), ejabberd_cluster:call(Node, gen_mod, stop_module, [Host, Module]), + ejabberd_cluster:call(Node, ejabberd_config, add_option, + [modules, NewMods]), ejabberd_cluster:call(Node, gen_mod, start_module, - [Host, Module, Opts]), + [Host, Module]), throw(submitted); _ -> case lists:keysearch(<<"stop", SModule/binary>>,