Remove a bot when it quits.
[xudocci.git] / src / main / java / net / pterodactylus / irc / event / ClientQuit.java
diff --git a/src/main/java/net/pterodactylus/irc/event/ClientQuit.java b/src/main/java/net/pterodactylus/irc/event/ClientQuit.java
new file mode 100644 (file)
index 0000000..d7f7aff
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * XdccDownloader - ClientQuit.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.irc.event;
+
+import net.pterodactylus.irc.Connection;
+import net.pterodactylus.irc.Source;
+
+/**
+ * Notifies a listener that a client has quit.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class ClientQuit extends AbstractConnectionEvent {
+
+       /** The client that quit. */
+       private final Source client;
+
+       /** The message given by the client. */
+       private final String message;
+
+       /**
+        * Creates a new client quit event.
+        *
+        * @param connection
+        *              The connection on which the event occured
+        * @param client
+        *              The client that quit
+        * @param message
+        *              The message given by the client
+        */
+       public ClientQuit(Connection connection, Source client, String message) {
+               super(connection);
+               this.client = client;
+               this.message = message;
+       }
+
+       //
+       // ACCESSORS
+       //
+
+       /**
+        * Returns the client that quit.
+        *
+        * @return The client that quit
+        */
+       public Source client() {
+               return client;
+       }
+
+       /**
+        * Returns the message given by the client.
+        *
+        * @return The message given by the client
+        */
+       public String message() {
+               return message;
+       }
+
+}