From 48bed439024de07c8da5298aaff50110b60a85ea Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Wed, 31 Jul 2019 12:35:06 +0300 Subject: [PATCH] Don't render CAPTCHA whitelist when CAPTCHA is not configured Fixes #2970 --- src/mod_muc_room.erl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index ea1d3ee8d..cf4edeca2 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -3527,11 +3527,15 @@ get_config(Lang, StateData, From) -> {pubsub, Config#config.pubsub}] ++ case ejabberd_captcha:is_feature_available() of - true -> [{captcha_protected, Config#config.captcha_protected}]; - false -> [] - end ++ - [{captcha_whitelist, - lists:map(fun jid:make/1, ?SETS:to_list(Config#config.captcha_whitelist))}] + true -> + [{captcha_protected, Config#config.captcha_protected}, + {captcha_whitelist, + lists:map( + fun jid:make/1, + ?SETS:to_list(Config#config.captcha_whitelist))}]; + false -> + [] + end ++ case mod_muc_log:check_access_log(StateData#state.server_host, From) of allow -> [{enablelogging, Config#config.logging}]; -- 2.40.0