import net.pterodactylus.irc.event.ConnectionFailed;
import net.pterodactylus.irc.event.DccAcceptReceived;
import net.pterodactylus.irc.event.DccSendReceived;
+import net.pterodactylus.irc.event.KickedFromChannel;
import net.pterodactylus.irc.event.MotdReceived;
import net.pterodactylus.irc.event.NicknameChanged;
import net.pterodactylus.irc.event.NicknameInUseReceived;
eventBus.post(new MotdReceived(this, motd.toString()));
motd.setLength(0);
+ } else if (command.equals("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));
--- /dev/null
+package net.pterodactylus.irc.event;
+
+import net.pterodactylus.irc.Connection;
+import net.pterodactylus.irc.Source;
+
+import com.google.common.base.Optional;
+
+/**
+ * Event that signals that a client was kicked from a channel.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class KickedFromChannel extends AbstractChannelEvent {
+
+ private final Source kicker;
+ private final String kickee;
+ private final Optional<String> reason;
+
+ public KickedFromChannel(Connection connection, String channel, Source kicker, String kickee, Optional<String> reason) {
+ super(connection, channel);
+ this.kicker = kicker;
+ this.kickee = kickee;
+ this.reason = reason;
+ }
+
+ public Source kicker() {
+ return kicker;
+ }
+
+ public String kickee() {
+ return kickee;
+ }
+
+ public Optional<String> reason() {
+ return reason;
+ }
+
+}