From a40e9c2626aec1bd0df074af2e78bc2f8367811c Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Thu, 23 Dec 2010 16:28:35 +0200 Subject: [PATCH] Remove version=1.0 from stream opening when TLS is not available (thanks to Karim Gemayel) --- src/ejabberd_s2s_in.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 6ad53721c..369573edb 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -208,8 +208,12 @@ wait_for_stream({xmlstreamstart, Opening}, StateData) -> send_element(StateData, exmpp_stream:features(Features)), {next_state, stream_established, StateData}; {?NS_JABBER_SERVER, true, _Server, _} -> - Opening_Reply = exmpp_stream:opening_reply(Opening, - StateData#state.streamid), + #xmlel{attrs = Attrs} = Opening, + New_Attrs = exmpp_xml:remove_attribute_from_list( + Attrs, <<"version">>), + Opening_Reply = exmpp_stream:opening_reply( + Opening#xmlel{attrs = New_Attrs}, + StateData#state.streamid), send_element(StateData, exmpp_stream:set_dialback_support(Opening_Reply)), {next_state, stream_established, StateData};