force tls for registrations as well

This commit is contained in:
iNPUTmice 2014-10-19 23:14:17 +02:00
parent a201f9e53f
commit c9238ef5ae
1 changed files with 5 additions and 2 deletions

View File

@ -583,10 +583,10 @@ public class XmppConnection implements Runnable {
} else if (compressionAvailable()) {
sendCompressionZlib();
} else if (this.streamFeatures.hasChild("register")
&& (account.isOptionSet(Account.OPTION_REGISTER))) {
&& account.isOptionSet(Account.OPTION_REGISTER) && usingEncryption) {
sendRegistryRequest();
} else if (!this.streamFeatures.hasChild("register")
&& (account.isOptionSet(Account.OPTION_REGISTER))) {
&& account.isOptionSet(Account.OPTION_REGISTER)) {
changeStatus(Account.STATUS_REGISTRATION_NOT_SUPPORTED);
disconnect(true);
} else if (this.streamFeatures.hasChild("mechanisms")
@ -606,6 +606,9 @@ public class XmppConnection implements Runnable {
this.tagWriter.writeStanzaAsync(resume);
} else if (this.streamFeatures.hasChild("bind") && shouldBind) {
sendBindRequest();
} else {
Log.d(Config.LOGTAG,account.getJid()+": incompatible server. disconnecting");
disconnect(true);
}
}