diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-02-16 11:00:26 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-02-16 11:10:24 +0300 |
commit | 8b2d3084986defd6045a0c02706415e0e7ae4b3f (patch) | |
tree | 419b64fc2d07646d221fdfa2f526e057fb34c6d2 /test | |
parent | Merge branch 'master' of github.com:processone/ejabberd (diff) |
Change routing API
Now 'From' and 'To' arguments must be omitted in functions
and structures related to routing.
The commit deprecates the following functions:
ejabberd_router:route/3 in favor of ejabberd_router:route/1
ejabberd_router:route_error/4 in favor of ejabberd_router:route_error/2
ejabberd_local:route_iq/4 in favor of ejabberd_local:route_iq/2
ejabberd_local:route_iq/5 in favor of ejabberd_local:route_iq/3
The format of {route, From, To, Packet} is changed in favor of {route, Packet}
Diffstat (limited to 'test')
-rw-r--r-- | test/carbons_tests.erl | 2 | ||||
-rw-r--r-- | test/ejabberd_SUITE.erl | 3 | ||||
-rw-r--r-- | test/privacy_tests.erl | 4 | ||||
-rw-r--r-- | test/sm_tests.erl | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/test/carbons_tests.erl b/test/carbons_tests.erl index a85cece8c..f703bb2c8 100644 --- a/test/carbons_tests.erl +++ b/test/carbons_tests.erl @@ -146,7 +146,7 @@ send_messages(Config) -> end; ({recv, #message{} = Msg}) -> ejabberd_router:route( - JID, MyJID, Msg#message{from = JID, to = MyJID}), + Msg#message{from = JID, to = MyJID}), ct:comment("Receiving message ~s", [xmpp:pp(Msg)]), #message{} = recv_message(Config) end, message_iterator(Config)). diff --git a/test/ejabberd_SUITE.erl b/test/ejabberd_SUITE.erl index cd68a21b8..089d9d6a6 100644 --- a/test/ejabberd_SUITE.erl +++ b/test/ejabberd_SUITE.erl @@ -766,7 +766,8 @@ s2s_ping(Config) -> From = my_jid(Config), To = jid:make(?MNESIA_VHOST), ID = randoms:get_string(), - ejabberd_s2s:route(From, To, #iq{id = ID, type = get, sub_els = [#ping{}]}), + ejabberd_s2s:route(#iq{from = From, to = To, id = ID, + type = get, sub_els = [#ping{}]}), #iq{type = result, id = ID, sub_els = []} = recv_iq(Config), disconnect(Config). diff --git a/test/privacy_tests.erl b/test/privacy_tests.erl index fdde64958..054925aab 100644 --- a/test/privacy_tests.erl +++ b/test/privacy_tests.erl @@ -785,12 +785,12 @@ server_send_iqs(Config) -> lists:foreach( fun(Type) -> ejabberd_router:route( - ServerJID, MyJID, #iq{type = Type}) + #iq{from = ServerJID, to = MyJID, type = Type}) end, [error, result]), lists:foreach( fun(Type) -> ejabberd_local:route_iq( - ServerJID, MyJID, #iq{type = Type}, + #iq{from = ServerJID, to = MyJID, type = Type}, fun(#iq{type = result, sub_els = []}) -> ok; (IQ) -> ct:fail({unexpected_iq_result, IQ}) end) diff --git a/test/sm_tests.erl b/test/sm_tests.erl index d2ec3bd56..fac22ca2f 100644 --- a/test/sm_tests.erl +++ b/test/sm_tests.erl @@ -77,7 +77,7 @@ resume(Config) -> Txt = #text{data = <<"body">>}, Msg = #message{from = ServerJID, to = MyJID, body = [Txt]}, %% Route message. The message should be queued by the C2S process. - ejabberd_router:route(ServerJID, MyJID, Msg), + ejabberd_router:route(Msg), send(Config, #sm_resume{previd = ID, h = 0, xmlns = ?NS_STREAM_MGMT_3}), #sm_resumed{previd = ID, h = 3} = recv(Config), #message{from = ServerJID, to = MyJID, body = [Txt]} = recv_message(Config), |