mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Add improved archive upload progress.
This commit is contained in:
committed by
Greyson Parrelli
parent
981808d074
commit
6d5be0b445
@@ -1808,6 +1808,21 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
.readToSingleInt()
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a set of thread ids, return the count of all messages in the table that match that thread id. This will include *all* messages, and is
|
||||
* explicitly for use as a "fuzzy total"
|
||||
*/
|
||||
fun getApproximateExportableMessageCount(threadIds: Set<Long>): Long {
|
||||
val queries = SqlUtil.buildCollectionQuery(THREAD_ID, threadIds)
|
||||
return queries.sumOf {
|
||||
readableDatabase.count()
|
||||
.from("$TABLE_NAME INDEXED BY $INDEX_THREAD_COUNT")
|
||||
.where(it.where, it.whereArgs)
|
||||
.run()
|
||||
.readToSingleLong(0L)
|
||||
}
|
||||
}
|
||||
|
||||
fun canSetUniversalTimer(threadId: Long): Boolean {
|
||||
if (threadId == -1L) {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user