Don’t store connection status anymore.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 16 Oct 2014 19:51:23 +0000 (21:51 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 16 Oct 2014 19:51:23 +0000 (21:51 +0200)
src/main/java/net/pterodactylus/irc/Connection.java

index 86de535..4d601fd 100644 (file)
@@ -374,8 +374,6 @@ public class Connection extends AbstractExecutionThreadService implements Servic
                /* now read replies and react. */
                try {
                        /* some status variables. */
-                       int oldConnectionStatus = 0;
-                       int connectionStatus = 0;
                        boolean connected = true;
                        StringBuilder motd = new StringBuilder();
                        Set<Nickname> nicks = Sets.newHashSet();
@@ -432,7 +430,7 @@ public class Connection extends AbstractExecutionThreadService implements Servic
                                } else if (command.equals("431")) {
                                        eventBus.post(new NoNicknameGivenReceived(this, reply));
                                } else if (command.equals("433")) {
-                                       if (connectionStatus == 0) {
+                                       if (!established.get()) {
                                                nickname = nicknameChooser.getNickname();
                                                connectionHandler.sendCommand("NICK", nickname);
                                        } else {