25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Check if mod_muc_log is enabled before setting logging option (#3215)

This commit is contained in:
Badlop 2020-04-17 15:01:37 +02:00
parent 4aa85c538c
commit 101f7a6d63

View File

@ -995,6 +995,15 @@ change_room_option(Name, Service, OptionString, ValueString) ->
room_not_found;
Pid ->
{Option, Value} = format_room_option(OptionString, ValueString),
change_room_option(Pid, Option, Value)
end.
change_room_option(Pid, Option, Value) ->
case {Option,
gen_mod:is_loaded((get_room_state(Pid))#state.server_host, mod_muc_log)} of
{logging, false} ->
mod_muc_log_not_enabled;
_ ->
Config = get_room_config(Pid),
Config2 = change_option(Option, Value, Config),
{ok, _} = mod_muc_room:set_config(Pid, Config2),