From d3424cc0a583928086afd06244acdfd21a9113f5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 8 May 2016 13:57:48 +0300 Subject: fix ejabberd dialback --- src/main/java/com/juick/xmpp/s2s/ConnectionOut.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java index 4ebeffb6..5ef5fd3c 100644 --- a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java +++ b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java @@ -45,8 +45,8 @@ public class ConnectionOut extends Connection implements Runnable { } void sendOpenStream() throws IOException { - sendStanza(""); } @@ -64,9 +64,7 @@ public class ConnectionOut extends Connection implements Runnable { try { HostnamePort addr = DNSQueries.getServerAddress(to); socket = new Socket(InetAddress.getByName(addr.hostname), addr.port); - parser.setInput(new InputStreamReader(socket.getInputStream())); - - writer = new OutputStreamWriter(socket.getOutputStream()); + restartParser(); sendOpenStream(); @@ -78,6 +76,10 @@ public class ConnectionOut extends Connection implements Runnable { LOGGER.info("STREAM TO " + to + " " + streamID + " OPEN"); XMPPComponent.addConnectionOut(ConnectionOut.this); + boolean xmppversionnew = parser.getAttributeValue(null, "version") != null; + if (!xmppversionnew) { + processDialback(); + } while (parser.next() != XmlPullParser.END_DOCUMENT) { if (parser.getEventType() != XmlPullParser.START_TAG) { -- cgit v1.2.3