Don't set from/to attributes in resource binding iq

This commit is contained in:
Evgeniy Khramtsov 2018-07-04 08:57:28 +03:00
parent 86236431b9
commit bce8922e5d
1 changed files with 2 additions and 4 deletions

View File

@ -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},