]> granicus.if.org Git - ejabberd/commitdiff
Don't render CAPTCHA whitelist when CAPTCHA is not configured
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Wed, 31 Jul 2019 09:35:06 +0000 (12:35 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Wed, 31 Jul 2019 09:35:06 +0000 (12:35 +0300)
Fixes #2970

src/mod_muc_room.erl

index ea1d3ee8d98fb077257dad2f6e7714689a7da24c..cf4edeca2568d2d19b7377dcb1d0ac5bec69728f 100644 (file)
@@ -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}];