Merge pull request #2680 from Iperity/fix-privacy-check-on-presence-probe

Privacy lists: set from/to on packet *before* calling privacy_check_p…
This commit is contained in:
badlop 2019-01-09 16:31:14 +01:00 committed by GitHub
commit 325877446a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -638,15 +638,16 @@ route_probe_reply(From, #{jid := To,
Subscription = get_subscription(To, From),
if IsAnotherResource orelse
Subscription == both orelse Subscription == from ->
Packet = misc:add_delay_info(LastPres, To, TS),
case privacy_check_packet(State, Packet, out) of
Packet = xmpp:set_from_to(LastPres, To, From),
Packet2 = misc:add_delay_info(Packet, To, TS),
case privacy_check_packet(State, Packet2, out) of
deny ->
ok;
allow ->
ejabberd_hooks:run(presence_probe_hook,
LServer,
[From, To, self()]),
ejabberd_router:route(xmpp:set_from_to(Packet, To, From))
ejabberd_router:route(Packet2)
end;
true ->
ok