mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Add s2s_out_bounce_packet hook
This commit is contained in:
parent
f650b1e83c
commit
f6b5a52104
@ -360,10 +360,17 @@ bounce_message_queue(FromTo, State) ->
|
|||||||
|
|
||||||
-spec bounce_packet(xmpp_element(), state()) -> state().
|
-spec bounce_packet(xmpp_element(), state()) -> state().
|
||||||
bounce_packet(Pkt, State) when ?is_stanza(Pkt) ->
|
bounce_packet(Pkt, State) when ?is_stanza(Pkt) ->
|
||||||
Lang = xmpp:get_lang(Pkt),
|
#{server_host := Host} = State,
|
||||||
Err = mk_bounce_error(Lang, State),
|
case ejabberd_hooks:run_fold(
|
||||||
ejabberd_router:route_error(Pkt, Err),
|
s2s_out_bounce_packet, Host, State, [Pkt]) of
|
||||||
|
ignore ->
|
||||||
State;
|
State;
|
||||||
|
State2 ->
|
||||||
|
Lang = xmpp:get_lang(Pkt),
|
||||||
|
Err = mk_bounce_error(Lang, State2),
|
||||||
|
ejabberd_router:route_error(Pkt, Err),
|
||||||
|
State2
|
||||||
|
end;
|
||||||
bounce_packet(_, State) ->
|
bounce_packet(_, State) ->
|
||||||
State.
|
State.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user