From cb77298f5299198ce8ddd191601361e873d55c6d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 8 Jun 2023 17:46:47 -0400 Subject: [PATCH] Correctly processing multiple matching via find and not match --- .../java/com/vitorpamplona/amethyst/model/AntiSpamFilter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/AntiSpamFilter.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/AntiSpamFilter.kt index c7cd96354..32d258fb0 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/AntiSpamFilter.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/AntiSpamFilter.kt @@ -28,7 +28,7 @@ class AntiSpamFilter { // if the message is actually short but because it cites a user/event, the nostr: string is really long, make it ok. // The idea here is to avoid considering repeated "@Bot, command" messages spam, while still blocking repeated "lnbc..." invoices or fishing urls - if (event.content.length < 180 && Nip19.nip19regex.matcher(event.content).matches()) return false + if (event.content.length < 180 && Nip19.nip19regex.matcher(event.content).find()) return false // double list strategy: // if duplicated, it goes into spam. 1000 spam messages are saved into the spam list.