mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
* src/ejabberd_router.erl: Added route_packet hook
SVN Revision: 380
This commit is contained in:
parent
02d3151ee7
commit
e9e1893b01
@ -1,3 +1,7 @@
|
|||||||
|
2005-07-27 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/ejabberd_router.erl: Added route_packet hook
|
||||||
|
|
||||||
2005-07-26 Alexey Shchepin <alexey@sevcom.net>
|
2005-07-26 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
* src/jd2ejd.erl: Updated to work with ODBC
|
* src/jd2ejd.erl: Updated to work with ODBC
|
||||||
|
@ -80,8 +80,13 @@ loop() ->
|
|||||||
loop()
|
loop()
|
||||||
end.
|
end.
|
||||||
|
|
||||||
do_route(From, To, Packet) ->
|
do_route(OrigFrom, OrigTo, OrigPacket) ->
|
||||||
?DEBUG("route~n\tfrom ~p~n\tto ~p~n\tpacket ~p~n", [From, To, Packet]),
|
?DEBUG("route~n\tfrom ~p~n\tto ~p~n\tpacket ~p~n",
|
||||||
|
[OrigFrom, OrigTo, OrigPacket]),
|
||||||
|
LOrigDstDomain = OrigTo#jid.lserver,
|
||||||
|
case ejabberd_hooks:run_fold(
|
||||||
|
route_packet, LOrigDstDomain, {OrigFrom, OrigTo, OrigPacket}, []) of
|
||||||
|
{From, To, Packet} ->
|
||||||
LDstDomain = To#jid.lserver,
|
LDstDomain = To#jid.lserver,
|
||||||
case mnesia:dirty_read(route, LDstDomain) of
|
case mnesia:dirty_read(route, LDstDomain) of
|
||||||
[] ->
|
[] ->
|
||||||
@ -116,9 +121,11 @@ do_route(From, To, Packet) ->
|
|||||||
Pid ! {route, From, To, Packet}
|
Pid ! {route, From, To, Packet}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end;
|
||||||
|
drop ->
|
||||||
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
%route(From, To, Packet) ->
|
%route(From, To, Packet) ->
|
||||||
% ejabberd_router ! {route, From, To, Packet}.
|
% ejabberd_router ! {route, From, To, Packet}.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user