Skip to content

Add reply functionality. #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/main/java/com/gikk/twirk/Twirk.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,32 @@ public void whisper(String userName, String message){
queue.add("PRIVMSG " + channel + " :/w " + userName + " " + message);
}

/**Enqueues a message at the end of the message queue. The message will be
* sent to the channel when all messages enqueued before it has been sent.
*
* @param message The message that should be sent
*/
public void channelMessage(String message){
queue.add("PRIVMSG " + channel + " :" + message);
}

/**Enqueues a message at the end of the message queue. The message will be
* sent to the channel when all messages enqueued before it has been sent.
*
* @param message The message that should be sent
* @param messageId The message id to reply to
*/
public void channelMessage(String message, String replyTarget){
queue.add("@reply-parent-msg-id=" + replyTarget + " PRIVMSG " + channel + " :" + message);
}

/**Enqueues a message at the front of the message queue. The message will be sent as soon as possible.
*
* @param message The message that should be sent
* @param messageId The message id to reply to
*/
public void channelMessage(String message){
queue.add("PRIVMSG " + channel + " :" + message);
public void priorityChannelMessage(String message, String replyTarget){
queue.addFirst("@reply-parent-msg-id=" + replyTarget + " PRIVMSG " + channel + " :" + message);
}

/**Enqueues a message at the front of the message queue. The message will be sent as soon as possible.
Expand Down