From fb32712c6918214283285a99e2171ab282ab6a38 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:52:17 +0200 Subject: [PATCH] Move topic handling into the 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 5345294..0b23305 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -378,7 +378,10 @@ public class Connection extends AbstractExecutionThreadService implements Servic s.get(), p.get(0))) .addCommand("JOIN", (s, p) -> new ChannelJoined(this, - p.get(0), s.get())), + p.get(0), s.get())) + .addCommand("332", + (s, p) -> new ChannelTopic(this, p.get(1), + p.get(2))), new MotdHandler(eventBus, this), new ChannelNotJoinedHandler(eventBus, this), new ConnectionEstablishHandler(eventBus, this), @@ -411,8 +414,6 @@ public class Connection extends AbstractExecutionThreadService implements Servic /* channel stuff. */ } else if (command.equals("331")) { /* no topic is set. */ - } else if (command.equals("332")) { - eventBus.post(new ChannelTopic(this, parameters.get(1), parameters.get(2))); } else if (command.equalsIgnoreCase("PART")) { eventBus.post(new ChannelLeft(this, parameters.get(0), reply.source().get(), getOptional(parameters, 1))); } else if (command.equalsIgnoreCase("QUIT")) { -- 2.7.4