mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
spjspj - Prevent some types of spam in the main chat
This commit is contained in:
parent
060084f971
commit
5e6836a8f6
1 changed files with 6 additions and 0 deletions
|
@ -106,6 +106,7 @@ public class ChatManager {
|
||||||
this.broadcast(chatId, userName, message, color, withTime, messageType, null);
|
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) {
|
public void broadcast(UUID chatId, String userName, String message, MessageColor color, boolean withTime, MessageType messageType, SoundToPlay soundToPlay) {
|
||||||
ChatSession chatSession = chatSessions.get(chatId);
|
ChatSession chatSession = chatSessions.get(chatId);
|
||||||
if (chatSession != null) {
|
if (chatSession != null) {
|
||||||
|
@ -118,6 +119,11 @@ public class ChatManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.equals(lastMessage)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastMessage = message;
|
||||||
chatSession.broadcast(userName, message, color, withTime, messageType, soundToPlay);
|
chatSession.broadcast(userName, message, color, withTime, messageType, soundToPlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue