Add method to send messages.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 04:21:15 +0000 (06:21 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 04:21:15 +0000 (06:21 +0200)
src/main/java/net/pterodactylus/irc/Connection.java

index d127363..ade43c9 100644 (file)
@@ -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
        //