mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Add paging for getArchivedRecipients.
This commit is contained in:
@@ -962,9 +962,19 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
}
|
||||
|
||||
fun getArchivedRecipients(): Set<RecipientId> {
|
||||
return getArchivedConversationList(ConversationFilter.OFF).readToList { cursor ->
|
||||
RecipientId.from(cursor.requireLong(RECIPIENT_ID))
|
||||
}.toSet()
|
||||
var offset = 0L
|
||||
val result = mutableSetOf<RecipientId>()
|
||||
|
||||
do {
|
||||
val recipientIds = getArchivedConversationList(ConversationFilter.OFF, offset, 500).readToList { cursor ->
|
||||
RecipientId.from(cursor.requireLong(RECIPIENT_ID))
|
||||
}
|
||||
|
||||
result.addAll(recipientIds)
|
||||
offset += recipientIds.size
|
||||
} while (recipientIds.isNotEmpty())
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
fun getInboxPositions(): Map<RecipientId, Int> {
|
||||
|
||||
Reference in New Issue
Block a user