From 0de89ca5b773f37ddf449ba40d4874c93e46c2bc Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 8 Jan 2017 11:57:16 +1100 Subject: [PATCH] Some Chat Manager updates --- Mage.Server/src/main/java/mage/server/ChatManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/ChatManager.java b/Mage.Server/src/main/java/mage/server/ChatManager.java index 06ed16d14d..272ea8e9eb 100644 --- a/Mage.Server/src/main/java/mage/server/ChatManager.java +++ b/Mage.Server/src/main/java/mage/server/ChatManager.java @@ -127,20 +127,23 @@ public class ChatManager { } if (!messageType.equals(MessageType.GAME)) { - + User user = UserManager.getInstance().getUserByName(userName); if (message != null && userName != null && !userName.equals("")) { if (message.equals(userMessages.get(userName))) { // prevent identical messages + String informUser = "Your message appears to be identical to your last message"; + chatSessions.get(chatId).broadcastInfoToUser(user, informUser); return; } userMessages.put(userName, message); if (containsSwearing(message)) { + String informUser = "Your message appears to contain profanity"; + chatSessions.get(chatId).broadcastInfoToUser(user, informUser); return; } } if (messageType.equals(MessageType.TALK)) { - User user = UserManager.getInstance().getUserByName(userName); if (user != null) { if (user.getChatLockedUntil() != null) { if (user.getChatLockedUntil().compareTo(Calendar.getInstance().getTime()) > 0) {