From 5b53a640eeac25451b83feee3e0552453e31789c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 22 Jun 2011 09:04:55 +0200 Subject: Don't emit connection lost events before the connection is built up git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@589 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/network/ConnectionControl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/jrummikub/control/network/ConnectionControl.java b/src/jrummikub/control/network/ConnectionControl.java index b5e3ac5..f4d5f64 100644 --- a/src/jrummikub/control/network/ConnectionControl.java +++ b/src/jrummikub/control/network/ConnectionControl.java @@ -646,6 +646,8 @@ public class ConnectionControl implements IConnectionControl { } if (error == null) { + connection.addConnectionListener(new DisconnectListener()); + requestGames(); emitLater(connectedEvent); } else { @@ -659,7 +661,6 @@ public class ConnectionControl implements IConnectionControl { private LoginError doConnect() { try { connection.connect(); - connection.addConnectionListener(new DisconnectListener()); return null; } catch (XMPPException e) { XMPPError xmppError = e.getXMPPError(); @@ -816,14 +817,14 @@ public class ConnectionControl implements IConnectionControl { private abstract class SendRunner implements Runnable { Message message; - + public SendRunner() { DefaultPacketExtension extension = createJRummikubExtension(); addData(extension); message = createMessage(extension); modifyMessage(message); } - + @Override public void run() { // For thread safety -- cgit v1.2.3