Add client-side user ignore list

This commit adds a client-side per-server ignore list.
* Whispers and talk from an ignored user is hidden
* Ignored users cannot join your tables
* Ignored users tables are hidden
This commit is contained in:
Anders Åstrand 2017-02-22 20:17:26 +01:00
parent 19fec8ee2a
commit f68460603a
22 changed files with 443 additions and 18 deletions

View file

@ -271,8 +271,8 @@ public class ChatPanelBasic extends javax.swing.JPanel {
if (color.equals(MessageColor.YELLOW)) {
textColor = "Yellow";
}
if (messageType == MessageType.WHISPER) {
if (username.equalsIgnoreCase("Whisper from " + SessionHandler.getUserName())) {
if (messageType == MessageType.WHISPER_FROM) {
if (username.equalsIgnoreCase(SessionHandler.getUserName())) {
if (message.toLowerCase().startsWith("profanity 0")) {
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "0");
} else if (message.toLowerCase().startsWith("profanity 1")) {
@ -281,6 +281,10 @@ public class ChatPanelBasic extends javax.swing.JPanel {
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "2");
}
}
username = "Whisper from " + username;
}
if (messageType == MessageType.WHISPER_TO) {
username = "Whisper to " + username;
}
Matcher matchPattern = cardNamePattern.matcher(message);