./ct_report/coverage/mongoose_router_localdomain.COVER.html

1 %%%-------------------------------------------------------------------
2 %%% @doc
3 %%% Part of a routing chain: searches for a route registered for the domain,
4 %%% forwards the message there, or passes on.
5 %%% @end
6 %%%-------------------------------------------------------------------
7 -module(mongoose_router_localdomain).
8 -author('bartlomiej.gorny@erlang-solutions.com').
9
10 -behaviour(xmpp_router).
11
12 -include("jlib.hrl").
13
14 %% xmpp_router callback
15 -export([filter/4, route/4]).
16
17 filter(From, To, Acc, Packet) ->
18 51216 {From, To, Acc, Packet}.
19
20 route(From, To, Acc0, Packet) ->
21 51405 LDstDomain = To#jid.lserver,
22 51405 case mongoose_router:lookup_route(LDstDomain) of
23 338 no_route -> {From, To, Acc0, Packet};
24 Handler ->
25 51067 Acc1 = mongoose_local_delivery:do_route(From, To, Acc0, Packet, Handler),
26 51063 {done, Acc1}
27 end.
Line Hits Source