From bce8922e5d03b157b64425be23e68e21b5e5c3db Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 4 Jul 2018 08:57:28 +0300 Subject: [PATCH] Don't set from/to attributes in resource binding iq --- src/xmpp_stream_out.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/xmpp_stream_out.erl b/src/xmpp_stream_out.erl index f11aaf743..c79204ea0 100644 --- a/src/xmpp_stream_out.erl +++ b/src/xmpp_stream_out.erl @@ -739,15 +739,13 @@ process_sasl_failure(Reason, State) -> -spec process_bind(stream_features(), state()) -> state(). process_bind(StreamFeatures, #{lang := Lang, xmlns := ?NS_CLIENT, - user := U, server := S, resource := R, + resource := R, stream_state := StateName} = State) when StateName /= established, StateName /= disconnected -> case xmpp:has_subtag(StreamFeatures, #bind{}) of true -> - JID = jid:make(U, S, R), ID = new_id(), - Pkt = #iq{from = JID, to = jid:remove_resource(JID), - id = ID, type = set, + Pkt = #iq{id = ID, type = set, sub_els = [#bind{resource = R}]}, State1 = State#{stream_state => wait_for_bind_response, bind_id => ID},