Treat the part message as optional.
[xudocci.git] / src / main / java / net / pterodactylus / irc / event / ChannelLeft.java
index e9c52f3..00b088a 100644 (file)
@@ -20,6 +20,8 @@ package net.pterodactylus.irc.event;
 import net.pterodactylus.irc.Connection;
 import net.pterodactylus.irc.Source;
 
+import com.google.common.base.Optional;
+
 /**
  * Event that notifies a listener that a client has left a channel.
  *
@@ -31,7 +33,7 @@ public class ChannelLeft extends AbstractChannelEvent {
        private final Source client;
 
        /** The message given by the client. */
-       private final String message;
+       private final Optional<String> message;
 
        /**
         * Creates a new channel joined event.
@@ -43,7 +45,7 @@ public class ChannelLeft extends AbstractChannelEvent {
         * @param message
         *              The message given by the client
         */
-       public ChannelLeft(Connection connection, String channel, Source client, String message) {
+       public ChannelLeft(Connection connection, String channel, Source client, Optional<String> message) {
                super(connection, channel);
                this.client = client;
                this.message = message;
@@ -67,7 +69,7 @@ public class ChannelLeft extends AbstractChannelEvent {
         *
         * @return The message given by the client
         */
-       public String message() {
+       public Optional<String> message() {
                return message;
        }