Fix get_module_opt call in mod_block_strangers

This commit is contained in:
Alexey Shchepin 2017-07-10 16:05:09 +03:00 committed by Christophe Romain
parent 5c48ba4609
commit e5f64bc24a
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ filter_packet({#message{} = Msg, State} = Acc) ->
LBFrom = jid:remove_resource(LFrom),
#{pres_a := PresA, jid := JID, lserver := LServer} = State,
AllowLocalUsers =
gen_mod:get_module_opt(LServer, ?MODULE, allow_local_users, true),
gen_mod:get_module_opt(
LServer, ?MODULE, allow_local_users,
fun(B) when is_boolean(B) -> B end,
true),
case (Msg#message.body == [] andalso
Msg#message.subject == [])
orelse (AllowLocalUsers andalso