From 7c20e05bf9bcaf60cb9b26df2ef7adbf57ad63fd Mon Sep 17 00:00:00 2001 From: melkypie <5113962+melkypie@users.noreply.github.com> Date: Thu, 23 Jan 2020 22:53:36 +0200 Subject: [PATCH] chatcommands: fix cox pb tracking --- .../client/plugins/chatcommands/ChatCommandsPlugin.java | 5 +++-- .../client/plugins/chatcommands/ChatCommandsPluginTest.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 669d7c775f..283b09b750 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -88,7 +88,7 @@ public class ChatCommandsPlugin extends Plugin { private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap|completion) count is: (\\d+)"); private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); - private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("Congratulations - your raid is complete! Duration ([0-9:]+)"); + private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("Congratulations - your raid is complete! Duration: ([0-9:]+)"); private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); private static final Pattern BARROWS_PATTERN = Pattern.compile("Your Barrows chest count is: (\\d+)"); private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: [0-9:]+\\. Personal best: ([0-9:]+)"); @@ -215,7 +215,8 @@ public class ChatCommandsPlugin extends Plugin { if (chatMessage.getType() != ChatMessageType.TRADE && chatMessage.getType() != ChatMessageType.GAMEMESSAGE - && chatMessage.getType() != ChatMessageType.SPAM) + && chatMessage.getType() != ChatMessageType.SPAM + && chatMessage.getType() != ChatMessageType.FRIENDSCHATNOTIFICATION) { return; } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index 69e3b01397..ab7daaff99 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -29,6 +29,7 @@ import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import java.util.concurrent.ScheduledExecutorService; import javax.inject.Inject; +import static net.runelite.api.ChatMessageType.FRIENDSCHATNOTIFICATION; import static net.runelite.api.ChatMessageType.GAMEMESSAGE; import static net.runelite.api.ChatMessageType.TRADE; import net.runelite.api.Client; @@ -366,7 +367,7 @@ public class ChatCommandsPluginTest { when(client.getUsername()).thenReturn("Adam"); - ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Congratulations - your raid is complete! Duration 37:04", null, 0); + ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "Congratulations - your raid is complete! Duration: 37:04", null, 0); chatCommandsPlugin.onChatMessage(chatMessage); chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Chambers of Xeric count is: 51.", null, 0); @@ -382,7 +383,7 @@ public class ChatCommandsPluginTest when(client.getUsername()).thenReturn("Adam"); when(configManager.getConfiguration(anyString(), anyString(), any())).thenReturn(2224); - ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Congratulations - your raid is complete! Duration 1:45:04", null, 0); + ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "Congratulations - your raid is complete! Duration: 1:45:04", null, 0); chatCommandsPlugin.onChatMessage(chatMessage); chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Chambers of Xeric count is: 52.", null, 0);