mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
Don't route error/groupchat messages to bare JIDs
As per RFC 6121, drop error messages that were sent to bare JIDs, and return an error if a groupchat message was sent to a bare JID.
This commit is contained in:
parent
bc008d4041
commit
8f9a2d6df8
@ -516,7 +516,18 @@ do_route(From, To, #xmlel{} = Packet) ->
|
||||
PResources);
|
||||
true -> ok
|
||||
end;
|
||||
<<"message">> -> route_message(From, To, Packet);
|
||||
<<"message">> ->
|
||||
case xml:get_attr_s(<<"type">>, Attrs) of
|
||||
<<"chat">> -> route_message(From, To, Packet);
|
||||
<<"headline">> -> route_message(From, To, Packet);
|
||||
<<"error">> -> ok;
|
||||
<<"groupchat">> ->
|
||||
Err = jlib:make_error_reply(Packet,
|
||||
?ERR_SERVICE_UNAVAILABLE),
|
||||
ejabberd_router:route(To, From, Err);
|
||||
_ ->
|
||||
route_message(From, To, Packet)
|
||||
end;
|
||||
<<"iq">> -> process_iq(From, To, Packet);
|
||||
_ -> ok
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user