25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Use 'to' field only in the first client stream initialization

This commit is contained in:
Alexey Shchepin 2014-01-20 16:06:05 +02:00
parent 155c8bb29a
commit d63be79df9

View File

@ -291,7 +291,12 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
DefaultLang = ?MYLANG, DefaultLang = ?MYLANG,
case xml:get_attr_s(<<"xmlns:stream">>, Attrs) of case xml:get_attr_s(<<"xmlns:stream">>, Attrs) of
?NS_STREAM -> ?NS_STREAM ->
Server = jlib:nameprep(xml:get_attr_s(<<"to">>, Attrs)), Server =
case StateData#state.server of
undefined ->
jlib:nameprep(xml:get_attr_s(<<"to">>, Attrs));
S -> S
end,
case lists:member(Server, ?MYHOSTS) of case lists:member(Server, ?MYHOSTS) of
true -> true ->
Lang = case xml:get_attr_s(<<"xml:lang">>, Attrs) of Lang = case xml:get_attr_s(<<"xml:lang">>, Attrs) of