fix: run 'component_send_packet' hook in global mode
This commit is contained in:
parent
7b3d26992b
commit
e17a16a300
|
@ -185,13 +185,13 @@ handle_auth_failure(_, Mech, Reason,
|
||||||
Reason]),
|
Reason]),
|
||||||
State.
|
State.
|
||||||
|
|
||||||
handle_authenticated_packet(Pkt0, #{server := Server, ip := {IP, _}, lang := Lang} = State)
|
handle_authenticated_packet(Pkt0, #{ip := {IP, _}, lang := Lang} = State)
|
||||||
when ?is_stanza(Pkt0) ->
|
when ?is_stanza(Pkt0) ->
|
||||||
Pkt = xmpp:put_meta(Pkt0, ip, IP),
|
Pkt = xmpp:put_meta(Pkt0, ip, IP),
|
||||||
From = xmpp:get_from(Pkt),
|
From = xmpp:get_from(Pkt),
|
||||||
case check_from(From, State) of
|
case check_from(From, State) of
|
||||||
true ->
|
true ->
|
||||||
{Pkt2, State2} = ejabberd_hooks:run_fold(component_send_packet, Server, {Pkt, State}, []),
|
{Pkt2, State2} = ejabberd_hooks:run_fold(component_send_packet, {Pkt, State}, []),
|
||||||
case Pkt2 of
|
case Pkt2 of
|
||||||
drop ->
|
drop ->
|
||||||
ok;
|
ok;
|
||||||
|
|
Loading…
Reference in New Issue