mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-15 18:48:52 +01:00
Show warning when enabling autoDelete
This commit is contained in:
@@ -66,8 +66,11 @@ import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.math.sqrt
|
||||
|
||||
@Singleton
|
||||
@@ -724,4 +727,14 @@ class MessageRepositoryImpl @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
override fun getOldMessageCounts(maxAgeDays: Int): Map<Long, Int> {
|
||||
return Realm.getDefaultInstance().use { realm ->
|
||||
realm.where(Message::class.java)
|
||||
.lessThan("date", now() - TimeUnit.DAYS.toMillis(maxAgeDays.toLong()))
|
||||
.findAll()
|
||||
.groupingBy { message -> message.threadId }
|
||||
.eachCount()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user