eventBus.post(new ChannelNicknames(this, parameters.get(1), nicks));
nicks.clear();
} else if (command.equalsIgnoreCase("PART")) {
- eventBus.post(new ChannelLeft(this, parameters.get(0), reply.source().get(), parameters.get(1)));
+ 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)));
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.
*
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.
* @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;
*
* @return The message given by the client
*/
- public String message() {
+ public Optional<String> message() {
return message;
}