mark account with incompatible server when no sasl mechansim could be found

This commit is contained in:
Daniel Gultsch 2015-05-02 12:10:56 +02:00
parent 48e8e0f1fc
commit c4bfffe6a9

View file

@ -581,6 +581,7 @@ public class XmppConnection implements Runnable {
} else if (mechanisms.contains("DIGEST-MD5")) { } else if (mechanisms.contains("DIGEST-MD5")) {
saslMechanism = new DigestMd5(tagWriter, account, mXmppConnectionService.getRNG()); saslMechanism = new DigestMd5(tagWriter, account, mXmppConnectionService.getRNG());
} }
if (saslMechanism != null) {
final JSONObject keys = account.getKeys(); final JSONObject keys = account.getKeys();
try { try {
if (keys.has(Account.PINNED_MECHANISM_KEY) && if (keys.has(Account.PINNED_MECHANISM_KEY) &&
@ -601,6 +602,10 @@ public class XmppConnection implements Runnable {
auth.setContent(saslMechanism.getClientFirstMessage()); auth.setContent(saslMechanism.getClientFirstMessage());
} }
tagWriter.writeElement(auth); tagWriter.writeElement(auth);
} else {
disconnect(true);
changeStatus(Account.State.INCOMPATIBLE_SERVER);
}
} else if (this.streamFeatures.hasChild("sm", "urn:xmpp:sm:" } else if (this.streamFeatures.hasChild("sm", "urn:xmpp:sm:"
+ smVersion) + smVersion)
&& streamId != null) { && streamId != null) {