From: David ‘Bombe’ Roden Date: Wed, 22 Oct 2014 19:54:53 +0000 (+0200) Subject: Move quit handling into simple command handler. X-Git-Url: https://git.pterodactylus.net/?p=xudocci.git;a=commitdiff_plain;h=a6afa8e9183160cc4ea87c4ddeaa3b60142c84c7 Move quit handling into simple command handler. --- diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 5b69add..332b0b1 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -384,7 +384,10 @@ public class Connection extends AbstractExecutionThreadService implements Servic p.get(2))) .addCommand("PART", (s, p) -> new ChannelLeft(this, p.get(0), - s.get(), getOptional(p, 1))), + s.get(), getOptional(p, 1))) + .addCommand("QUIT", + (s, p) -> new ClientQuit(this, s.get(), + p.get(0))), new MotdHandler(eventBus, this), new ChannelNotJoinedHandler(eventBus, this), new ConnectionEstablishHandler(eventBus, this), @@ -417,8 +420,6 @@ public class Connection extends AbstractExecutionThreadService implements Servic /* channel stuff. */ } else if (command.equals("331")) { /* no topic is set. */ - } else if (command.equalsIgnoreCase("QUIT")) { - eventBus.post(new ClientQuit(this, reply.source().get(), parameters.get(0))); /* basic connection housekeeping. */ } else if (command.equalsIgnoreCase("PING")) {