Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Command notify should not be case sensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed May 8, 2015
1 parent c7c5437 commit 061ffee
Showing 1 changed file with 15 additions and 9 deletions.
Expand Up @@ -45,9 +45,9 @@ public GamePlayerCommandPreprocessingListener(PurpleIRC plugin) {
*/
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {
if (event.isCancelled()) {
if (event.isCancelled()) {
return;
}
}
String msg = event.getMessage();
if (event.getPlayer().hasPermission("irc.message.gamechat")) {
if (msg.startsWith("/me ")) {
Expand All @@ -60,17 +60,20 @@ public void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {
}
}
}
if (plugin.isPluginEnabled("Essentials")) {
if (msg.startsWith("/helpop ") || msg.startsWith("/amsg ") || msg.startsWith("/ac ")) {
if (msg.contains(" ")) {
String message = msg.split(" ", 2)[1];
for (PurpleBot ircBot : plugin.ircBots.values()) {
if (plugin.isPluginEnabled("Essentials")) {
if (msg.startsWith("/helpop ") || msg.startsWith("/amsg ") || msg.startsWith("/ac ")) {
if (msg.contains(" ")) {
String message = msg.split(" ", 2)[1];
for (PurpleBot ircBot : plugin.ircBots.values()) {
ircBot.essHelpOp(event.getPlayer(), message);
}
}
}
}
for (PurpleBot ircBot : plugin.ircBots.values()) {
if (!ircBot.channelCmdNotifyEnabled) {
return;
}
if (msg.startsWith("/")) {
String cmd;
String params = "";
Expand All @@ -81,8 +84,11 @@ public void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {
cmd = msg;
}
cmd = cmd.substring(0);
if (ircBot.channelCmdNotifyEnabled && !ircBot.channelCmdNotifyIgnore.contains(cmd)) {
ircBot.commandNotify(event.getPlayer(), cmd, params);
for (String s : ircBot.channelCmdNotifyIgnore) {
if (s.equalsIgnoreCase(cmd)) {
ircBot.commandNotify(event.getPlayer(), cmd, params);
break;
}
}
}
}
Expand Down

0 comments on commit 061ffee

Please sign in to comment.