Add method to send messages.
[xudocci.git] / 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
        //