From c23b3fa4b938b7ba8e09f34f5e58ad5269f19f26 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 29 Mar 2018 11:10:53 +0300 Subject: server: fix races --- juick-server/src/main/java/com/juick/server/XMPPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-server/src') diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java index ee67a15c..87164755 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java +++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java @@ -126,7 +126,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener { public void init() { logger.info("stream router start connecting to {}", componentPort); xmpp.addStanzaListener(this); - broadcastPresence(null); router = ExternalComponent.create(componentName, password, session.getConfiguration(), "localhost", componentPort); PingManager pingManager = router.getManager(PingManager.class); @@ -279,6 +278,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener { try { Thread.sleep(3000); router.connect(); + broadcastPresence(null); } catch (InterruptedException | XmppException e) { logger.warn("xmpp exception", e); } -- cgit v1.2.3