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