From 16442c6548eee45095f8643484fc06f7a23d15af Mon Sep 17 00:00:00 2001 From: MrPowerGamerBR Date: Tue, 22 Oct 2024 15:52:11 -0300 Subject: [PATCH] Fix client ID check --- .../helper/utils/lorittaautomods/CheckDupeClientIds.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt b/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt index c5b83c8d..6b8f037c 100644 --- a/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt +++ b/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt @@ -67,13 +67,12 @@ class CheckDupeClientIds(val helper: LorittaHelper) : RunnableCoroutine { .toList() val usersToBeBanned = mutableListOf() - val alreadyChecked = mutableSetOf() for (clientIdThatAreBanned in clientIdsThatAreBanned) { - if (!alreadyChecked.contains(clientIdThatAreBanned[BannedUsers.userId])) { - val user = dailiesGotInLast24Hours.first { it[BrowserFingerprints.clientId] == clientIdThatAreBanned[BrowserFingerprints.clientId] } - // println("User ${user[Dailies.receivedById]} should be banned because ${clientIdThatAreBanned[BannedUsers.userId]} is banned") + val users = dailiesGotInLast24Hours.filter { it[BrowserFingerprints.clientId] == clientIdThatAreBanned[BrowserFingerprints.clientId] } + // println("User ${user[Dailies.receivedById]} should be banned because ${clientIdThatAreBanned[BannedUsers.userId]} is banned") + for (user in users) { usersToBeBanned.add( BannedUser( user[Dailies.receivedById], @@ -83,7 +82,6 @@ class CheckDupeClientIds(val helper: LorittaHelper) : RunnableCoroutine { user[Profiles.money] ) ) - alreadyChecked.add(clientIdThatAreBanned[BannedUsers.userId]) } }