1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Add XMPPConnection.getStreamId()

and remove getConnectionID().

Also make streamId a field of AbstractXMPPConnection. Most XMPP
connection types have a streamId, it appears to be optional when BOSH
is used though.
This commit is contained in:
Florian Schmaus 2015-01-28 17:14:33 +01:00
parent 612ca1ad9d
commit 5a56ff011b
5 changed files with 28 additions and 53 deletions

View file

@ -95,11 +95,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
private PipedWriter readerPipe;
private Thread readerConsumer;
/**
* The BOSH equivalent of the stream ID which is used for DIGEST authentication.
*/
protected String authID = null;
/**
* The session ID for the BOSH session with the connection manager.
*/
@ -147,7 +142,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
client = null;
}
sessionID = null;
authID = null;
// Initialize BOSH client
BOSHClientConfig.Builder cfgBuilder = BOSHClientConfig.Builder
@ -206,16 +200,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
callConnectionConnectedListener();
}
public String getConnectionID() {
if (!connected) {
return null;
} else if (authID != null) {
return authID;
} else {
return sessionID;
}
}
public boolean isSecureConnection() {
// TODO: Implement SSL usage
return false;
@ -298,7 +282,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
@Override
protected void shutdown() {
setWasAuthenticated();
authID = null;
sessionID = null;
done = true;
authenticated = false;
@ -525,8 +508,8 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
if (sessionID == null) {
sessionID = body.getAttribute(BodyQName.create(XMPPBOSHConnection.BOSH_URI, "sid"));
}
if (authID == null) {
authID = body.getAttribute(BodyQName.create(XMPPBOSHConnection.BOSH_URI, "authid"));
if (streamId == null) {
streamId = body.getAttribute(BodyQName.create(XMPPBOSHConnection.BOSH_URI, "authid"));
}
final XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);