mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2025-02-13 10:01:29 +01:00
Add irc-a-chat message type. Allows messages in channel to be sent directly to AdminPrivateChat
This commit is contained in:
parent
f412a99de6
commit
b2377e409f
@ -2361,7 +2361,7 @@ public final class PurpleBot {
|
||||
}
|
||||
} else {
|
||||
plugin.logDebug("NOPE we can't broadcast to HeroChat due to " + TemplateName.IRC_HERO_CHAT + " disabled");
|
||||
}
|
||||
}
|
||||
if (plugin.isPluginEnabled("Essentials")) {
|
||||
plugin.logDebug("Checking if " + TemplateName.IRC_ESS_HELPOP + " is enabled before broadcasting chat from IRC");
|
||||
if (enabledMessages.get(myChannel).contains(TemplateName.IRC_ESS_HELPOP) || override) {
|
||||
@ -2378,6 +2378,23 @@ public final class PurpleBot {
|
||||
+ " disabled");
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.adminPrivateChatHook != null) {
|
||||
plugin.logDebug("Checking if " + TemplateName.IRC_A_CHAT + " is enabled before broadcasting chat from IRC");
|
||||
if (enabledMessages.get(myChannel).contains(TemplateName.IRC_A_CHAT) || override) {
|
||||
plugin.logDebug("Yup we can broadcast due to " + TemplateName.IRC_A_CHAT + " enabled");
|
||||
String newMessage = filterMessage(
|
||||
plugin.tokenizer.ircChatToGameTokenizer(this, user, channel, plugin.getMsgTemplate(
|
||||
botNick, TemplateName.IRC_A_CHAT), message), myChannel);
|
||||
if (!newMessage.isEmpty()) {
|
||||
plugin.adminPrivateChatHook.sendMessage(newMessage, user.getNick());
|
||||
messageSent = true;
|
||||
}
|
||||
} else {
|
||||
plugin.logDebug("NOPE we can't broadcast due to " + TemplateName.IRC_A_CHAT + " disabled");
|
||||
}
|
||||
}
|
||||
|
||||
if (enabledMessages.get(myChannel).contains(TemplateName.IRC_CHAT_RESPONSE) && messageSent && target != null) {
|
||||
// Let the sender know the message was sent
|
||||
String responseTemplate = plugin.getMsgTemplate(botNick, TemplateName.IRC_CHAT_RESPONSE);
|
||||
@ -2389,6 +2406,7 @@ public final class PurpleBot {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Broadcast chat messages from IRC to specific hero channel
|
||||
|
@ -127,6 +127,7 @@ public class TemplateName {
|
||||
|
||||
public final static String IRC_A_RESPONSE = "irc-a-response";
|
||||
public final static String GAME_A_CHAT = "game-a-chat";
|
||||
public final static String IRC_A_CHAT = "irc-a-chat";
|
||||
|
||||
public final static String FAKE_JOIN = "fake-join";
|
||||
public final static String FAKE_QUIT = "fake-quit";
|
||||
|
@ -181,8 +181,10 @@ channels:
|
||||
#- broadcast-message
|
||||
# RedditStream
|
||||
#- reddit-messages
|
||||
# AdminPrivateChat messages
|
||||
# AdminPrivateChat messages game to IRC
|
||||
#- game-a-chat
|
||||
# AdminPrivateChat messages IRC to game
|
||||
#- irc-a-chat
|
||||
# Hero channel destination for IRC messages
|
||||
hero-channel: admin
|
||||
# Towny channel destination for IRC messages
|
||||
|
@ -123,8 +123,10 @@ message-format:
|
||||
irc-notice: '[&4IRC&r] [notice(%CHANNEL%)] %NOTICE% '
|
||||
# AdminPrivateChat response message in IRC. Set to '' to disable.
|
||||
irc-a-response: ' &6-> &7[AdminChat]: %MESSAGE%'
|
||||
# AdinPrivateChat message from game to IRC
|
||||
# AdminPrivateChat message from game to IRC
|
||||
game-a-chat: '[%WORLD%] <%NAME%> -> [AdminChat]: %MESSAGE%'
|
||||
# AdminPrivateChat message from IRC to game
|
||||
irc-a-chat: '[&4IRC&r] %MESSAGE%'
|
||||
# Message template for Clevernotch bot to IRC messages
|
||||
clever-send: '[&4BOT]<%NAME%> %MESSAGE%'
|
||||
# Message templates for mcMMO to IRC messages
|
||||
|
Loading…
Reference in New Issue
Block a user