diff options
author | HackOS <63157139+HackedOS@users.noreply.github.com> | 2022-05-15 18:52:56 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-15 15:22:56 +0200 |
commit | 7f7f8587d3e06354ef0cc80a1a06ef76ba0387ff (patch) | |
tree | 873f05b5676691a7684df5571d393881315f5987 /src/main/java/de/torui/coflsky/EventRegistry.java | |
parent | 01cf4007b7ab24937fb6c831be6ae7fc481d88ef (diff) | |
download | COFL-7f7f8587d3e06354ef0cc80a1a06ef76ba0387ff.tar.gz COFL-7f7f8587d3e06354ef0cc80a1a06ef76ba0387ff.tar.bz2 COFL-7f7f8587d3e06354ef0cc80a1a06ef76ba0387ff.zip |
Fix chat spam if chat regex is null and respect more privacy settings (#61)
* Fix chat spam if chat regex is null and respect more privacy settings
* optimize
* optimize regex
Diffstat (limited to 'src/main/java/de/torui/coflsky/EventRegistry.java')
-rw-r--r-- | src/main/java/de/torui/coflsky/EventRegistry.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/torui/coflsky/EventRegistry.java b/src/main/java/de/torui/coflsky/EventRegistry.java index 43276db..9d82f14 100644 --- a/src/main/java/de/torui/coflsky/EventRegistry.java +++ b/src/main/java/de/torui/coflsky/EventRegistry.java @@ -39,7 +39,7 @@ import static de.torui.coflsky.EventHandler.ScoreboardData; import static de.torui.coflsky.EventHandler.TabMenuData; public class EventRegistry { - public static Pattern chatpattern = Pattern.compile("", Pattern.CASE_INSENSITIVE); + public static Pattern chatpattern = Pattern.compile("a^", Pattern.CASE_INSENSITIVE); public final ExecutorService chatThreadPool = Executors.newFixedThreadPool(2); public final ExecutorService tickThreadPool = Executors.newFixedThreadPool(2); @SubscribeEvent @@ -134,7 +134,7 @@ public class EventRegistry { @SubscribeEvent public void HandleChatEvent(ClientChatReceivedEvent sce) { - if(CoflSky.Wrapper.isRunning) { + if(CoflSky.Wrapper.isRunning && Configuration.getInstance().collectChat) { chatThreadPool.submit(() -> { String msg = sce.message.getUnformattedText(); Matcher matcher = chatpattern.matcher(msg); |