mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Check if mod_muc_log is enabled before setting logging option (#3215)
This commit is contained in:
parent
4aa85c538c
commit
101f7a6d63
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user