mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Update routing for unavailable resources
As per RFC 6121, don't reroute non-chat messages sent to unavailable resources.
This commit is contained in:
parent
33c9f21171
commit
bc008d4041
@ -525,7 +525,15 @@ do_route(From, To, #xmlel{} = Packet) ->
|
||||
case Mod:get_sessions(LUser, LServer, LResource) of
|
||||
[] ->
|
||||
case Name of
|
||||
<<"message">> -> route_message(From, To, Packet);
|
||||
<<"message">> ->
|
||||
case xml:get_attr_s(<<"type">>, Attrs) of
|
||||
<<"chat">> -> route_message(From, To, Packet);
|
||||
<<"error">> -> ok;
|
||||
_ ->
|
||||
Err = jlib:make_error_reply(Packet,
|
||||
?ERR_SERVICE_UNAVAILABLE),
|
||||
ejabberd_router:route(To, From, Err)
|
||||
end;
|
||||
<<"iq">> ->
|
||||
case xml:get_attr_s(<<"type">>, Attrs) of
|
||||
<<"error">> -> ok;
|
||||
|
Loading…
Reference in New Issue
Block a user