Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't block contacts with subscription=to in mod_block_strangers (#1609)
  • Loading branch information
alexeyshch committed Mar 21, 2017
1 parent 70050b5 commit 9fb188a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/mod_block_strangers.erl
Expand Up @@ -57,13 +57,19 @@ filter_packet({#message{} = Msg, State} = Acc) ->
From = xmpp:get_from(Msg),
LFrom = jid:tolower(From),
LBFrom = jid:remove_resource(LFrom),
#{pres_a := PresA} = State,
#{pres_a := PresA,
pres_t := PresT,
pres_f := PresF} = State,
case (Msg#message.body == [] andalso
Msg#message.subject == [])
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
orelse (?SETS):is_element(LBFrom, PresA)
orelse sets_bare_member(LBFrom, PresA)
orelse (?SETS):is_element(LFrom, PresT)
orelse (?SETS):is_element(LBFrom, PresT)
orelse (?SETS):is_element(LFrom, PresF)
orelse (?SETS):is_element(LBFrom, PresF) of
true ->
Acc;
false ->
Expand Down

0 comments on commit 9fb188a

Please sign in to comment.