Resolve crashing when trying to get the header letters for the contacts section of search.

This commit is contained in:
Alex Hart
2023-02-03 09:33:18 -04:00
parent 90695182f3
commit 25c96a6be6
3 changed files with 17 additions and 8 deletions

View File

@@ -3078,9 +3078,10 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
return readableDatabase.query(TABLE_NAME, SEARCH_PROJECTION, selection, args, null, null, orderBy)
}
fun querySignalContactLetterHeaders(inputQuery: String, includeSelf: Boolean): Map<RecipientId, String> {
fun querySignalContactLetterHeaders(inputQuery: String, includeSelf: Boolean, includePush: Boolean, includeSms: Boolean): Map<RecipientId, String> {
val searchSelection = ContactSearchSelection.Builder()
.withRegistered(true)
.withRegistered(includePush)
.withNonRegistered(includeSms)
.withGroups(false)
.excludeId(if (includeSelf) null else Recipient.self().id)
.withSearchQuery(inputQuery)