mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 18:29:45 +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:
parent
612ca1ad9d
commit
5a56ff011b
5 changed files with 28 additions and 53 deletions
|
@ -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()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue