25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Drop only messages with <body/> in mod_block_strangers

This commit is contained in:
Alexey Shchepin 2017-01-17 01:34:40 +03:00
parent fd4f5c0996
commit a23c76fb82

View File

@ -55,7 +55,8 @@ filter_packet({#message{} = Msg, State} = Acc) ->
LFrom = jid:tolower(From),
LBFrom = jid:remove_resource(LFrom),
#{pres_a := PresA} = State,
case ejabberd_router:is_my_route(From#jid.lserver)
case Msg#message.body == []
orelse ejabberd_router:is_my_route(From#jid.lserver)
orelse (?SETS):is_element(LFrom, PresA)
orelse (?SETS):is_element(LBFrom, PresA)
orelse sets_bare_member(LBFrom, PresA) of