Merge pull request #13063 from spjspj/master

Fix profanity filter
This commit is contained in:
spjspj 2024-12-01 20:55:00 +11:00 committed by GitHub
commit 78913ac84b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -265,7 +265,7 @@ public class ChatPanelBasic extends javax.swing.JPanel {
} }
String cachedProfanityFilterValue = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "0"); String cachedProfanityFilterValue = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "0");
boolean isContainsSwearing = !containsSwearing(messageToTest, cachedProfanityFilterValue); boolean isContainsSwearing = containsSwearing(messageToTest, cachedProfanityFilterValue);
boolean isUserInfoOrGameOrStatus = messageType == MessageType.USER_INFO || messageType == MessageType.GAME || messageType == MessageType.STATUS; boolean isUserInfoOrGameOrStatus = messageType == MessageType.USER_INFO || messageType == MessageType.GAME || messageType == MessageType.STATUS;
if (isUserInfoOrGameOrStatus || cachedProfanityFilterValue.equals("0") || (!cachedProfanityFilterValue.equals("0") && !isContainsSwearing)) { if (isUserInfoOrGameOrStatus || cachedProfanityFilterValue.equals("0") || (!cachedProfanityFilterValue.equals("0") && !isContainsSwearing)) {
if (username != null && !username.isEmpty()) { if (username != null && !username.isEmpty()) {