mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
* src/ejabberd_s2s.erl: Added s2s_send_packet and s2s_receive_packet hooks (EJAB-635).
* src/ejabberd_s2s_in.erl: Likewise. SVN Revision: 1342
This commit is contained in:
parent
cf42ea0bcb
commit
5e9576ffa3
@ -1,5 +1,9 @@
|
|||||||
2008-05-22 Mickael Remond <mremond@process-one.net>
|
2008-05-22 Mickael Remond <mremond@process-one.net>
|
||||||
|
|
||||||
|
* src/ejabberd_s2s.erl: Added s2s_send_packet and s2s_receive_packet
|
||||||
|
hooks (EJAB-635).
|
||||||
|
* src/ejabberd_s2s_in.erl: Likewise.
|
||||||
|
|
||||||
* src/ejabberd_c2s.erl: user_send_packet hook now called on all packets
|
* src/ejabberd_c2s.erl: user_send_packet hook now called on all packets
|
||||||
including presence packets (EJAB-634)
|
including presence packets (EJAB-634)
|
||||||
|
|
||||||
|
@ -256,6 +256,11 @@ do_route(From, To, Packet) ->
|
|||||||
NewAttrs = jlib:replace_from_to_attrs(jlib:jid_to_string(From),
|
NewAttrs = jlib:replace_from_to_attrs(jlib:jid_to_string(From),
|
||||||
jlib:jid_to_string(To),
|
jlib:jid_to_string(To),
|
||||||
Attrs),
|
Attrs),
|
||||||
|
#jid{lserver = MyServer} = From,
|
||||||
|
ejabberd_hooks:run(
|
||||||
|
s2s_send_packet,
|
||||||
|
MyServer,
|
||||||
|
[From, To, Packet]),
|
||||||
send_element(Pid, {xmlelement, Name, NewAttrs, Els}),
|
send_element(Pid, {xmlelement, Name, NewAttrs, Els}),
|
||||||
ok;
|
ok;
|
||||||
{aborted, _Reason} ->
|
{aborted, _Reason} ->
|
||||||
|
@ -412,6 +412,10 @@ stream_established({xmlstreamelement, El}, StateData) ->
|
|||||||
if ((Name == "iq") or
|
if ((Name == "iq") or
|
||||||
(Name == "message") or
|
(Name == "message") or
|
||||||
(Name == "presence")) ->
|
(Name == "presence")) ->
|
||||||
|
ejabberd_hooks:run(
|
||||||
|
s2s_receive_packet,
|
||||||
|
LFrom,
|
||||||
|
[From, To, NewEl]),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
From, To, NewEl);
|
From, To, NewEl);
|
||||||
true ->
|
true ->
|
||||||
@ -427,6 +431,10 @@ stream_established({xmlstreamelement, El}, StateData) ->
|
|||||||
if ((Name == "iq") or
|
if ((Name == "iq") or
|
||||||
(Name == "message") or
|
(Name == "message") or
|
||||||
(Name == "presence")) ->
|
(Name == "presence")) ->
|
||||||
|
ejabberd_hooks:run(
|
||||||
|
s2s_receive_packet,
|
||||||
|
LFrom,
|
||||||
|
[From, To, NewEl]),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
From, To, NewEl);
|
From, To, NewEl);
|
||||||
true ->
|
true ->
|
||||||
|
Loading…
Reference in New Issue
Block a user