Add "You can pull to filter" tip.

This commit is contained in:
Alex Hart
2023-01-04 09:57:14 -04:00
committed by Greyson Parrelli
parent 43fe789807
commit 296a113c65
20 changed files with 297 additions and 117 deletions

View File

@@ -615,7 +615,7 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
}
}
fun getFilteredConversationList(filter: List<RecipientId>): Cursor? {
fun getFilteredConversationList(filter: List<RecipientId>, unreadOnly: Boolean): Cursor? {
if (filter.isEmpty()) {
return null
}
@@ -625,7 +625,7 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
val cursors: MutableList<Cursor> = LinkedList()
for (recipientIds in splitRecipientIds) {
var selection = "$TABLE_NAME.$RECIPIENT_ID = ?"
var selection = "($TABLE_NAME.$RECIPIENT_ID = ?"
val selectionArgs = arrayOfNulls<String>(recipientIds.size)
for (i in 0 until recipientIds.size - 1) {
@@ -638,6 +638,12 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
i++
}
selection += if (unreadOnly) {
") AND $TABLE_NAME.$READ != ${ReadStatus.READ.serialize()}"
} else {
")"
}
val query = createQuery(selection, "$DATE DESC", 0, 0)
cursors.add(db.rawQuery(query, selectionArgs))
}