mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +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().
|
||||
bounce_packet(Pkt, State) when ?is_stanza(Pkt) ->
|
||||
Lang = xmpp:get_lang(Pkt),
|
||||
Err = mk_bounce_error(Lang, State),
|
||||
ejabberd_router:route_error(Pkt, Err),
|
||||
State;
|
||||
#{server_host := Host} = State,
|
||||
case ejabberd_hooks:run_fold(
|
||||
s2s_out_bounce_packet, Host, State, [Pkt]) of
|
||||
ignore ->
|
||||
State;
|
||||
State2 ->
|
||||
Lang = xmpp:get_lang(Pkt),
|
||||
Err = mk_bounce_error(Lang, State2),
|
||||
ejabberd_router:route_error(Pkt, Err),
|
||||
State2
|
||||
end;
|
||||
bounce_packet(_, State) ->
|
||||
State.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user