mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-24 15:22:07 +01:00
Move duplicate code in AbstractXMPPConnection
from XMPP(TCP|BOSH)Connection.
This commit is contained in:
parent
489a48bf86
commit
013f4d630a
4 changed files with 9 additions and 12 deletions
|
@ -198,11 +198,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
||||||
+ getHost() + ":" + getPort() + ".";
|
+ getHost() + ":" + getPort() + ".";
|
||||||
throw new SmackException(errorMessage);
|
throw new SmackException(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait with SASL auth until the SASL mechanisms have been received
|
|
||||||
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
|
|
||||||
|
|
||||||
callConnectionConnectedListener();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSecureConnection() {
|
public boolean isSecureConnection() {
|
||||||
|
|
|
@ -369,6 +369,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
|
|
||||||
// Perform the actual connection to the XMPP service
|
// Perform the actual connection to the XMPP service
|
||||||
connectInternal();
|
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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
||||||
@Override
|
@Override
|
||||||
protected void connectInternal() {
|
protected void connectInternal() {
|
||||||
connected = true;
|
connected = true;
|
||||||
|
saslFeatureReceived.reportSuccess();
|
||||||
streamId = "dummy-" + new Random(new Date().getTime()).nextInt();
|
streamId = "dummy-" + new Random(new Date().getTime()).nextInt();
|
||||||
|
|
||||||
if (reconnect) {
|
if (reconnect) {
|
||||||
|
|
|
@ -885,13 +885,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
|
|
||||||
// We connected successfully to the servers TCP port
|
// We connected successfully to the servers TCP port
|
||||||
initConnection();
|
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue