X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Firc%2FConnection.java;h=332b0b12ec2ca007b80f17f1671828e1653fb45c;hb=a6afa8e9183160cc4ea87c4ddeaa3b60142c84c7;hp=0b233057c1788bdbc5e3997d1dc1974bedf03c7c;hpb=fb32712c6918214283285a99e2171ab282ab6a38;p=xudocci.git diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 0b23305..332b0b1 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -381,7 +381,13 @@ public class Connection extends AbstractExecutionThreadService implements Servic p.get(0), s.get())) .addCommand("332", (s, p) -> new ChannelTopic(this, p.get(1), - p.get(2))), + p.get(2))) + .addCommand("PART", + (s, p) -> new ChannelLeft(this, p.get(0), + 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), @@ -414,10 +420,6 @@ public class Connection extends AbstractExecutionThreadService implements Servic /* channel stuff. */ } else if (command.equals("331")) { /* no topic is set. */ - } else if (command.equalsIgnoreCase("PART")) { - eventBus.post(new ChannelLeft(this, parameters.get(0), reply.source().get(), getOptional(parameters, 1))); - } else if (command.equalsIgnoreCase("QUIT")) { - eventBus.post(new ClientQuit(this, reply.source().get(), parameters.get(0))); /* basic connection housekeeping. */ } else if (command.equalsIgnoreCase("PING")) {