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

@ -144,8 +144,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
*/
private Socket socket;
private String connectionID = null;
/**
*
*/
@ -298,14 +296,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
serviceName).build());
}
@Override
public String getConnectionID() {
if (!isConnected()) {
return null;
}
return connectionID;
}
@Override
protected void throwNotConnectedExceptionIfAppropriate() throws NotConnectedException {
if (packetWriter == null) {
@ -893,7 +883,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
if (localpart != null) {
from = XmppStringUtils.completeJidFrom(localpart, to);
}
String id = getConnectionID();
String id = getStreamId();
send(new StreamOpen(to, from, id));
try {
packetReader.parser = PacketParserUtils.newXmppParser(reader);
@ -956,7 +946,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
case "stream":
// We found an opening stream.
if ("jabber:client".equals(parser.getNamespace(null))) {
connectionID = parser.getAttributeValue("", "id");
streamId = parser.getAttributeValue("", "id");
String reportedServiceName = parser.getAttributeValue("", "from");
assert(reportedServiceName.equals(config.getServiceName()));
}