Move duplicate code in AbstractXMPPConnection

from XMPP(TCP|BOSH)Connection.
This commit is contained in:
Florian Schmaus 2016-11-12 11:03:44 +01:00
parent 489a48bf86
commit 013f4d630a
4 changed files with 9 additions and 12 deletions

View File

@ -198,11 +198,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
+ getHost() + ":" + getPort() + ".";
throw new SmackException(errorMessage);
}
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
callConnectionConnectedListener();
}
public boolean isSecureConnection() {

View File

@ -369,6 +369,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
// Perform the actual connection to the XMPP service
connectInternal();
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
// Make note of the fact that we're now connected.
connected = true;
callConnectionConnectedListener();
return this;
}

View File

@ -90,6 +90,7 @@ public class DummyConnection extends AbstractXMPPConnection {
@Override
protected void connectInternal() {
connected = true;
saslFeatureReceived.reportSuccess();
streamId = "dummy-" + new Random(new Date().getTime()).nextInt();
if (reconnect) {

View File

@ -885,13 +885,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
// We connected successfully to the servers TCP port
initConnection();
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
// Make note of the fact that we're now connected.
connected = true;
callConnectionConnectedListener();
}
/**