From 32912dccba0d2b74b1cc2b5b30af5725368ca613 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 22 Oct 2014 21:46:51 +0200 Subject: [PATCH] Move join handling into simple command handler. --- src/main/java/net/pterodactylus/irc/Connection.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 30344be..82e2ea1 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -374,7 +374,10 @@ public class Connection extends AbstractExecutionThreadService implements Servic new NoNicknameGivenReceived(this))) .addCommand("NICK", (s, p) -> eventBus.post( new NicknameChanged(this, s.get(), - p.get(0)))), + p.get(0)))) + .addCommand("JOIN", (s, p) -> eventBus.post( + new ChannelJoined(this, p.get(0), + s.get()))), new MotdHandler(eventBus, this), new ChannelNotJoinedHandler(eventBus, this), new ConnectionEstablishHandler(eventBus, this), @@ -405,8 +408,6 @@ public class Connection extends AbstractExecutionThreadService implements Servic } /* channel stuff. */ - } else if (command.equalsIgnoreCase("JOIN")) { - eventBus.post(new ChannelJoined(this, parameters.get(0), reply.source().get())); } else if (command.equals("331")) { /* no topic is set. */ } else if (command.equals("332")) { -- 2.7.4