diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-22 09:04:55 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-22 09:04:55 +0200 |
commit | 5b53a640eeac25451b83feee3e0552453e31789c (patch) | |
tree | 5b7ddaf949b1037560cb92b00afd0f57f5298bbd /src/jrummikub/control/network | |
parent | 483382946bd5813d2b96adde2c9406d2be1150c2 (diff) | |
download | JRummikub-5b53a640eeac25451b83feee3e0552453e31789c.tar JRummikub-5b53a640eeac25451b83feee3e0552453e31789c.zip |
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
Diffstat (limited to 'src/jrummikub/control/network')
-rw-r--r-- | src/jrummikub/control/network/ConnectionControl.java | 7 |
1 files changed, 4 insertions, 3 deletions
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 |