Show reason if channel can not be joined because the nickname is not registered.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 15 Oct 2014 20:30:24 +0000 (22:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 15 Oct 2014 20:30:24 +0000 (22:30 +0200)
src/main/java/net/pterodactylus/irc/Connection.java
src/main/java/net/pterodactylus/irc/event/ChannelNotJoined.java

index 70ac0eb..2f89414 100644 (file)
@@ -453,6 +453,8 @@ public class Connection extends AbstractExecutionThreadService implements Servic
                                        eventBus.post(new ChannelNotJoined(this, parameters.get(1), Reason.inviteOnly));
                                } else if (command.equals("475")) {
                                        eventBus.post(new ChannelNotJoined(this, parameters.get(1), Reason.badChannelKey));
+                               } else if (command.equals("477")) {
+                                       eventBus.post(new ChannelNotJoined(this, parameters.get(1), Reason.registeredNicknamesOnly));
 
                                /* basic connection housekeeping. */
                                } else if (command.equalsIgnoreCase("PING")) {
index daaeded..fbbd876 100644 (file)
@@ -37,7 +37,8 @@ public class ChannelNotJoined extends AbstractChannelEvent {
                noSuchChannel,
                tooManyChannels,
                tooManyTargets,
-               unavailable
+               unavailable,
+               registeredNicknamesOnly
 
        }