From 44b20025048f5770b24ebd00425f830f6bd82ae3 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 10 Dec 2010 17:26:21 +0100 Subject: [PATCH] Include From attribute in the stream header of outgoing S2S connections --- src/ejabberd_s2s_out.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index b8d35ddad..00e7fa1a9 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -108,6 +108,7 @@ "xmlns:stream='http://etherx.jabber.org/streams' " "xmlns='jabber:server' " "xmlns:db='jabber:server:dialback' " + "from='~s' " "to='~s'~s>" ). @@ -227,7 +228,7 @@ open_socket(init, StateData) -> tls_enabled = false, streamid = new_id()}, send_text(NewStateData, io_lib:format(?STREAM_HEADER, - [StateData#state.server, + [StateData#state.myname, StateData#state.server, Version])), {next_state, wait_for_stream, NewStateData, ?FSMTIMEOUT}; {error, _Reason} -> @@ -561,7 +562,7 @@ wait_for_auth_result({xmlstreamelement, El}, StateData) -> ejabberd_socket:reset_stream(StateData#state.socket), send_text(StateData, io_lib:format(?STREAM_HEADER, - [StateData#state.server, + [StateData#state.myname, StateData#state.server, " version='1.0'"])), {next_state, wait_for_stream, StateData#state{streamid = new_id(), @@ -646,7 +647,7 @@ wait_for_starttls_proceed({xmlstreamelement, El}, StateData) -> }, send_text(NewStateData, io_lib:format(?STREAM_HEADER, - [StateData#state.server, + [StateData#state.myname, StateData#state.server, " version='1.0'"])), {next_state, wait_for_stream, NewStateData, ?FSMTIMEOUT}; _ ->