mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-26 16:30:52 +01:00
Merge branch 'dev' into 'dev'
cleaned up wordfilter See merge request morningstar/Arcturus-Community!300
This commit is contained in:
commit
4c73b37e21
@ -138,29 +138,14 @@ public class WordFilter {
|
|||||||
filteredMessage = this.normalise(filteredMessage);
|
filteredMessage = this.normalise(filteredMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
TObjectHashIterator iterator = this.words.iterator();
|
for (WordFilterWord word : this.words) {
|
||||||
|
if (!StringUtils.containsIgnoreCase(filteredMessage, word.key)) continue;
|
||||||
boolean foundShit = false;
|
if (habbo != null) {
|
||||||
|
if (Emulator.getPluginManager().fireEvent(new UserTriggerWordFilterEvent(habbo, word)).isCancelled())
|
||||||
while (iterator.hasNext()) {
|
continue;
|
||||||
WordFilterWord word = (WordFilterWord) iterator.next();
|
|
||||||
|
|
||||||
if (StringUtils.containsIgnoreCase(filteredMessage, word.key)) {
|
|
||||||
if (habbo != null) {
|
|
||||||
if (Emulator.getPluginManager().fireEvent(new UserTriggerWordFilterEvent(habbo, word)).isCancelled())
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
filteredMessage = filteredMessage.replace("(?i)" + word.key, word.replacement);
|
|
||||||
foundShit = true;
|
|
||||||
|
|
||||||
if (habbo != null && word.muteTime > 0) {
|
|
||||||
habbo.mute(word.muteTime, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!foundShit) {
|
filteredMessage = filteredMessage.replaceAll("(?i)" + Pattern.quote(word.key), word.replacement);
|
||||||
return message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return filteredMessage;
|
return filteredMessage;
|
||||||
|
Loading…
Reference in New Issue
Block a user