mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Add "You can pull to filter" tip.
This commit is contained in:
committed by
Greyson Parrelli
parent
43fe789807
commit
296a113c65
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user