From 3b0a131ca2a1b9efff6a917b53b6aed42087920a Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 15 Feb 2015 22:10:15 +1300 Subject: [PATCH] If private messaging is turned off, deny messages, even from friends. --- .../src/mineplex/core/message/MessageManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java index ae30a06f1..35dd7cb17 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java @@ -60,13 +60,15 @@ public class MessageManager extends MiniClientPlugin _punish = punish; _friendsManager = friendManager; _serverName = GetPlugin().getConfig().getString("serverstatus.name"); - + MessageHandler messageHandler = new MessageHandler(this); - ServerCommandManager.getInstance().registerCommandType("AnnouncementCommand", AnnouncementCommand.class, new AnnouncementHandler()); + ServerCommandManager.getInstance().registerCommandType("AnnouncementCommand", AnnouncementCommand.class, + new AnnouncementHandler()); ServerCommandManager.getInstance().registerCommandType("RedisMessage", RedisMessage.class, messageHandler); - ServerCommandManager.getInstance().registerCommandType("RedisMessageCallback", RedisMessageCallback.class, messageHandler); + ServerCommandManager.getInstance() + .registerCommandType("RedisMessageCallback", RedisMessageCallback.class, messageHandler); } public void AddCommands() @@ -113,7 +115,7 @@ public class MessageManager extends MiniClientPlugin { // If the receiver has turned off private messaging and the sender isn't a mod - if (!_friendsManager.isFriends(target, sender) && !_preferences.Get(target).PrivateMessaging) + if (!_preferences.Get(target).PrivateMessaging) { return C.cPurple + target.getName() + " has private messaging disabled."; @@ -472,7 +474,7 @@ public class MessageManager extends MiniClientPlugin // Include the sender's rank if this is a admin message. So we can format the receivers chat. adminMessage ? F.rank(_clientManager.Get(sender).GetRank()) : null); - + final UUID uuid = globalMessage.getUUID(); // A backup for the rare case where the message fails to deliver. Server doesn't respond