From: David ‘Bombe’ Roden Date: Wed, 22 Oct 2014 20:14:45 +0000 (+0200) Subject: Move kick handling into the simple command handler. X-Git-Url: https://git.pterodactylus.net/?p=xudocci.git;a=commitdiff_plain;h=4c0282c38d7959ae8060a5603a8fa66eb6aa7fd7 Move kick handling into the simple command handler. --- 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));