From c82a73fcb36e0304d0d15b554550ff9732287213 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 15 Oct 2014 22:30:24 +0200 Subject: [PATCH] Show reason if channel can not be joined because the nickname is not registered. --- src/main/java/net/pterodactylus/irc/Connection.java | 2 ++ src/main/java/net/pterodactylus/irc/event/ChannelNotJoined.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 70ac0eb..2f89414 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -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")) { diff --git a/src/main/java/net/pterodactylus/irc/event/ChannelNotJoined.java b/src/main/java/net/pterodactylus/irc/event/ChannelNotJoined.java index daaeded..fbbd876 100644 --- a/src/main/java/net/pterodactylus/irc/event/ChannelNotJoined.java +++ b/src/main/java/net/pterodactylus/irc/event/ChannelNotJoined.java @@ -37,7 +37,8 @@ public class ChannelNotJoined extends AbstractChannelEvent { noSuchChannel, tooManyChannels, tooManyTargets, - unavailable + unavailable, + registeredNicknamesOnly } -- 2.7.4