chatfilter: add config option for stripping accents

This commit is contained in:
Adam
2022-05-06 14:50:10 -04:00
parent 162a2f78cb
commit b5515075ef
3 changed files with 22 additions and 4 deletions

View File

@@ -191,6 +191,7 @@ public class ChatFilterPluginTest
{
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_WORDS);
when(chatFilterConfig.filteredWords()).thenReturn("filterme");
when(chatFilterConfig.stripAccents()).thenReturn(true);
chatFilterPlugin.updateFilteredPatterns();
assertEquals("plëäsë ******** plügïn", chatFilterPlugin.censorMessage("Blue", "plëäsë fïltërmë plügïn"));
@@ -211,6 +212,7 @@ public class ChatFilterPluginTest
{
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_WORDS);
when(chatFilterConfig.filteredWords()).thenReturn("plëäsë, filterme");
when(chatFilterConfig.stripAccents()).thenReturn(true);
chatFilterPlugin.updateFilteredPatterns();
assertEquals("****** ******** plügïn", chatFilterPlugin.censorMessage("Blue", "plëäsë fïltërmë plügïn"));