From 4c0282c38d7959ae8060a5603a8fa66eb6aa7fd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 22 Oct 2014 22:14:45 +0200 Subject: [PATCH] Move kick handling into the simple command handler. --- src/main/java/net/pterodactylus/irc/Connection.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 332b0b1..0e74955 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -387,7 +387,11 @@ public class Connection extends AbstractExecutionThreadService implements Servic s.get(), getOptional(p, 1))) .addCommand("QUIT", (s, p) -> new ClientQuit(this, s.get(), - p.get(0))), + p.get(0))) + .addCommand("KICK", + (s, p) -> new KickedFromChannel(this, + p.get(0), s.get(), p.get(1), + getOptional(p, 2))), new MotdHandler(eventBus, this), new ChannelNotJoinedHandler(eventBus, this), new ConnectionEstablishHandler(eventBus, this), @@ -425,9 +429,6 @@ public class Connection extends AbstractExecutionThreadService implements Servic } else if (command.equalsIgnoreCase("PING")) { connectionHandler.sendCommand("PONG", getOptional(parameters, 0), getOptional(parameters, 1)); - } else if (command.equalsIgnoreCase("KICK")) { - eventBus.post(new KickedFromChannel(this, parameters.get(0), reply.source().get(), parameters.get(1), getOptional(parameters, 2))); - /* okay, everything else. */ } else { eventBus.post(new UnknownReplyReceived(this, reply)); -- 2.7.4