Skip to content

Commit

Permalink
Fix client ID check
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Oct 22, 2024
1 parent 3db9476 commit 16442c6
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ class CheckDupeClientIds(val helper: LorittaHelper) : RunnableCoroutine {
.toList()

val usersToBeBanned = mutableListOf<BannedUser>()
val alreadyChecked = mutableSetOf<Long>()

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],
Expand All @@ -83,7 +82,6 @@ class CheckDupeClientIds(val helper: LorittaHelper) : RunnableCoroutine {
user[Profiles.money]
)
)
alreadyChecked.add(clientIdThatAreBanned[BannedUsers.userId])
}
}

Expand Down

0 comments on commit 16442c6

Please sign in to comment.