If mod_register access_from is 'none', then don't advertise IBR (#857)

This commit is contained in:
Badlop 2015-12-07 18:30:52 +01:00
parent 95a9100623
commit 3e57850da7
1 changed files with 5 additions and 2 deletions

View File

@ -72,8 +72,11 @@ stop(Host) ->
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host,
?NS_REGISTER).
stream_feature_register(Acc, _Host) ->
case lists:keymember(<<"mechanisms">>, 2, Acc) of
stream_feature_register(Acc, Host) ->
AF = gen_mod:get_module_opt(Host, ?MODULE, access_from,
fun(A) when is_atom(A) -> A end,
all),
case (AF /= none) and lists:keymember(<<"mechanisms">>, 2, Acc) of
true ->
[#xmlel{name = <<"register">>,
attrs = [{<<"xmlns">>, ?NS_FEATURE_IQREGISTER}],