diff options
author | Badlop <badlop@process-one.net> | 2020-04-17 15:01:37 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2020-04-17 16:19:58 +0200 |
commit | 101f7a6d634053c008775c1f36d396f1c3ecdd1b (patch) | |
tree | 200e4805e46f5013c308bca7b923f38ea3700593 /src | |
parent | When rescode is some unexpected, probably error message, print it (diff) |
Check if mod_muc_log is enabled before setting logging option (#3215)
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_muc_admin.erl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 78eca8e17..8e3d483b2 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -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), |