25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

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

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