From 3e5434124d9dc162883f4866174046799c3a3f33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 10 Apr 2013 06:21:15 +0200 Subject: [PATCH] Add method to send messages. --- src/main/java/net/pterodactylus/irc/Connection.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index d127363..ade43c9 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -207,6 +207,21 @@ public class Connection extends AbstractExecutionThreadService implements Servic connectionHandler.sendCommand("JOIN", channel); } + /** + * Sends a message to the given recipient, which may be a channel or another + * nickname. + * + * @param recipient + * The recipient of the message + * @param message + * The message + * @throws IOException + * if an I/O error occurs + */ + public void sendMessage(String recipient, String message) throws IOException { + connectionHandler.sendCommand("PRIVMSG", recipient, message); + } + // // ABSTRACTEXECUTIONTHREADSERVICE METHODS // -- 2.7.4