From: David ‘Bombe’ Roden Date: Tue, 9 Apr 2013 20:52:26 +0000 (+0200) Subject: Extract message into its own variable. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=882fc16df828ff923555c7893051558793ad128e;p=xudocci.git Extract message into its own variable. --- diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index ba4e283..2619204 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -260,10 +260,11 @@ public class Connection extends AbstractExecutionThreadService implements Servic /* most common events. */ if (command.equalsIgnoreCase("PRIVMSG")) { String recipient = parameters.get(0); + String message = parameters.get(1); if (!channelTypes.contains(recipient.charAt(0))) { - eventBus.post(new PrivateMessageReceived(this, reply.source().get(), parameters.get(1))); + eventBus.post(new PrivateMessageReceived(this, reply.source().get(), message)); } else { - eventBus.post(new ChannelMessageReceived(this, recipient, reply.source().get(), parameters.get(1))); + eventBus.post(new ChannelMessageReceived(this, recipient, reply.source().get(), message)); } /* replies 001-004 don’t hold information but they have to be sent on a successful connection. */