Merge pull request #2103 from spjspj/master

spjspj - Prevent some types of spam in the main chat
This commit is contained in:
spjspj 2016-07-24 01:59:50 +10:00 committed by GitHub
commit 9a56ca0b39

View file

@ -106,6 +106,7 @@ public class ChatManager {
this.broadcast(chatId, userName, message, color, withTime, messageType, null);
}
static String lastMessage = "";
public void broadcast(UUID chatId, String userName, String message, MessageColor color, boolean withTime, MessageType messageType, SoundToPlay soundToPlay) {
ChatSession chatSession = chatSessions.get(chatId);
if (chatSession != null) {
@ -118,6 +119,11 @@ public class ChatManager {
return;
}
}
if (message.equals(lastMessage)) {
return;
}
lastMessage = message;
chatSession.broadcast(userName, message, color, withTime, messageType, soundToPlay);
}
}