1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 00:02:06 +01:00

Call onOpenStream() in XmppNioTcpConnection

This commit is contained in:
Florian Schmaus 2019-02-15 23:17:12 +01:00
parent b3801b984a
commit 43bb418d99

View file

@ -86,6 +86,7 @@ import org.jivesoftware.smack.sasl.SASLErrorException;
import org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown; import org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown;
import org.jivesoftware.smack.util.Async; import org.jivesoftware.smack.util.Async;
import org.jivesoftware.smack.util.CollectionUtil; import org.jivesoftware.smack.util.CollectionUtil;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.UTF8; import org.jivesoftware.smack.util.UTF8;
import org.jivesoftware.smack.util.XmlStringBuilder; import org.jivesoftware.smack.util.XmlStringBuilder;
@ -101,6 +102,8 @@ import org.jxmpp.xml.splitter.XmlPrettyPrinter;
import org.jxmpp.xml.splitter.XmlPrinter; import org.jxmpp.xml.splitter.XmlPrinter;
import org.jxmpp.xml.splitter.XmppElementCallback; import org.jxmpp.xml.splitter.XmppElementCallback;
import org.jxmpp.xml.splitter.XmppXmlSplitter; import org.jxmpp.xml.splitter.XmppXmlSplitter;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/** /**
* Represents and manages a client connection to an XMPP server via TCP. * Represents and manages a client connection to an XMPP server via TCP.
@ -244,6 +247,15 @@ public class XmppNioTcpConnection extends AbstractXmppNioConnection {
this.streamOpen = streamOpen.toString(); this.streamOpen = streamOpen.toString();
this.streamClose = streamClose.toString(); this.streamClose = streamClose.toString();
XmlPullParser streamOpenParser;
try {
streamOpenParser = PacketParserUtils.getParserFor(this.streamOpen);
} catch (XmlPullParserException | IOException e) {
// Should never happen.
throw new AssertionError(e);
}
onStreamOpen(streamOpenParser);
} }
@Override @Override