deal with another set of stream:features after bind
This commit is contained in:
parent
560e63564d
commit
d51c4b9655
|
@ -83,7 +83,7 @@ public class XmppConnection implements Runnable {
|
||||||
private XmlReader tagReader;
|
private XmlReader tagReader;
|
||||||
private TagWriter tagWriter;
|
private TagWriter tagWriter;
|
||||||
private final Features features = new Features(this);
|
private final Features features = new Features(this);
|
||||||
private boolean shouldBind = true;
|
private boolean needsBinding = true;
|
||||||
private boolean shouldAuthenticate = true;
|
private boolean shouldAuthenticate = true;
|
||||||
private Element streamFeatures;
|
private Element streamFeatures;
|
||||||
private final HashMap<Jid, Info> disco = new HashMap<>();
|
private final HashMap<Jid, Info> disco = new HashMap<>();
|
||||||
|
@ -145,7 +145,7 @@ public class XmppConnection implements Runnable {
|
||||||
lastPingSent = SystemClock.elapsedRealtime();
|
lastPingSent = SystemClock.elapsedRealtime();
|
||||||
this.attempt++;
|
this.attempt++;
|
||||||
try {
|
try {
|
||||||
shouldAuthenticate = shouldBind = !account.isOptionSet(Account.OPTION_REGISTER);
|
shouldAuthenticate = needsBinding = !account.isOptionSet(Account.OPTION_REGISTER);
|
||||||
tagReader = new XmlReader(wakeLock);
|
tagReader = new XmlReader(wakeLock);
|
||||||
tagWriter = new TagWriter();
|
tagWriter = new TagWriter();
|
||||||
this.changeStatus(Account.State.CONNECTING);
|
this.changeStatus(Account.State.CONNECTING);
|
||||||
|
@ -634,11 +634,12 @@ public class XmppConnection implements Runnable {
|
||||||
}
|
}
|
||||||
final ResumePacket resume = new ResumePacket(this.streamId, stanzasReceived, smVersion);
|
final ResumePacket resume = new ResumePacket(this.streamId, stanzasReceived, smVersion);
|
||||||
this.tagWriter.writeStanzaAsync(resume);
|
this.tagWriter.writeStanzaAsync(resume);
|
||||||
} else if (this.streamFeatures.hasChild("bind") && shouldBind) {
|
} else if (needsBinding) {
|
||||||
|
if (this.streamFeatures.hasChild("bind")) {
|
||||||
sendBindRequest();
|
sendBindRequest();
|
||||||
} else {
|
} else {
|
||||||
disconnect(true);
|
throw new IncompatibleServerException();
|
||||||
changeStatus(Account.State.INCOMPATIBLE_SERVER);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -705,6 +706,7 @@ public class XmppConnection implements Runnable {
|
||||||
} catch (final InterruptedException ignored) {
|
} catch (final InterruptedException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
needsBinding = false;
|
||||||
clearIqCallbacks();
|
clearIqCallbacks();
|
||||||
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
|
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
|
||||||
iq.addChild("bind", "urn:ietf:params:xml:ns:xmpp-bind")
|
iq.addChild("bind", "urn:ietf:params:xml:ns:xmpp-bind")
|
||||||
|
|
Loading…
Reference in New Issue