From 8a9c435ee120d1384c55c419e11f9cf7c3a2e1c2 Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:12:24 +0100 Subject: Fix fire sale chat hider (#1147) --- src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index 05e7ab301..31f06ca01 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -327,6 +327,11 @@ class ChatFilter { "§aYou received §r§b\\+\\d{1,3} §r§a(Mithril|Gemstone) Powder.".toPattern(), "§aYou received §r(§6|§b)\\+[1-2] (Diamond|Gold) Essence§r§a.".toPattern(), ) + + private val fireSalePattern by RepoPattern.pattern( + "chat.firesale", + "§6§k§lA§r §c§lFIRE SALE §r§6§k§lA(?:\\n|.)*" + ) private val fireSalePatterns = listOf( "§c♨ §eFire Sales for .* §eare starting soon!".toPattern(), "§c\\s*♨ .* (?:Skin|Rune|Dye) §e(?:for a limited time )?\\(.* §eleft\\)(?:§c|!)".toPattern(), @@ -417,7 +422,7 @@ class ChatFilter { config.winterGift && message.isPresent("winter_gift") -> "winter_gift" config.powderMining && message.isPresent("powder_mining") -> "powder_mining" - config.fireSale && message.isPresent("fire_sale") -> "fire_sale" + config.fireSale && (fireSalePattern.matches(message) || message.isPresent("fire_sale")) -> "fire_sale" generalConfig.hideJacob && !GardenAPI.inGarden() && anitaFortunePattern.matches(message) -> "jacob_event" generalConfig.hideSkyMall && !LorenzUtils.inMiningIsland() && skymallPerkPattern.matches(message) -> "skymall" -- cgit