process stream features after success when we inlined bind but not sm

This commit is contained in:
Daniel Gultsch 2023-06-25 19:50:40 +02:00
parent 3e20358701
commit ca1ee4a565
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -775,7 +775,6 @@ public class XmppConnection implements Runnable {
+ ": server sent bound and resumed in SASL2 success"); + ": server sent bound and resumed in SASL2 success");
throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER); throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER);
} }
final boolean processNopStreamFeatures;
if (resumed != null && streamId != null) { if (resumed != null && streamId != null) {
if (this.boundStreamFeatures != null) { if (this.boundStreamFeatures != null) {
this.streamFeatures = this.boundStreamFeatures; this.streamFeatures = this.boundStreamFeatures;
@ -788,6 +787,8 @@ public class XmppConnection implements Runnable {
if (bound != null) { if (bound != null) {
clearIqCallbacks(); clearIqCallbacks();
this.isBound = true; this.isBound = true;
processNopStreamFeatures();
this.boundStreamFeatures = this.streamFeatures;
final Element streamManagementEnabled = final Element streamManagementEnabled =
bound.findChild("enabled", Namespace.STREAM_MANAGEMENT); bound.findChild("enabled", Namespace.STREAM_MANAGEMENT);
final Element carbonsEnabled = bound.findChild("enabled", Namespace.CARBONS); final Element carbonsEnabled = bound.findChild("enabled", Namespace.CARBONS);
@ -807,9 +808,6 @@ public class XmppConnection implements Runnable {
features.carbonsEnabled = true; features.carbonsEnabled = true;
} }
sendPostBindInitialization(waitForDisco, carbonsEnabled != null); sendPostBindInitialization(waitForDisco, carbonsEnabled != null);
processNopStreamFeatures = true;
} else {
processNopStreamFeatures = false;
} }
final HashedToken.Mechanism tokenMechanism; final HashedToken.Mechanism tokenMechanism;
if (SaslMechanism.hashedToken(currentSaslMechanism)) { if (SaslMechanism.hashedToken(currentSaslMechanism)) {
@ -831,11 +829,6 @@ public class XmppConnection implements Runnable {
+ ": no response to our hashed token request " + ": no response to our hashed token request "
+ this.hashTokenRequest); + this.hashTokenRequest);
} }
// a successful resume will not send stream features
if (processNopStreamFeatures) {
processNopStreamFeatures();
this.boundStreamFeatures = this.streamFeatures;
}
} }
mXmppConnectionService.databaseBackend.updateAccount(account); mXmppConnectionService.databaseBackend.updateAccount(account);
this.quickStartInProgress = false; this.quickStartInProgress = false;
@ -1551,7 +1544,9 @@ public class XmppConnection implements Runnable {
.addChild("device") .addChild("device")
.setContent(String.format("%s %s", Build.MANUFACTURER, Build.MODEL)); .setContent(String.format("%s %s", Build.MANUFACTURER, Build.MODEL));
} }
if (bind != null) { // do not include bind if 'inlinestreamManagment' is missing and we have a streamId
final boolean mayAttemptBind = streamId == null || inlineStreamManagement;
if (bind != null && mayAttemptBind) {
authenticate.addChild(generateBindRequest(bind)); authenticate.addChild(generateBindRequest(bind));
} }
if (inlineStreamManagement && streamId != null) { if (inlineStreamManagement && streamId != null) {