Only handle replies if the connection has not been established yet.
[xudocci.git] / src / main / java / net / pterodactylus / irc / connection / ConnectionEstablishHandler.java
index da608ca..741ece3 100644 (file)
@@ -34,7 +34,8 @@ public class ConnectionEstablishHandler implements Handler {
 
        @Override
        public boolean willHandle(Reply reply) {
-               return asList("001", "002", "003", "004").contains(reply.command());
+               return !isFinalConnectionStatusReached() &&
+                               asList("001", "002", "003", "004").contains(reply.command());
        }
 
        @Override