mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Improve call tab performance.
This commit is contained in:
committed by
Greyson Parrelli
parent
71c21eeba6
commit
0b24e42448
@@ -499,6 +499,27 @@ class Recipient(
|
||||
profileName.toString().isNotNullOrBlank()
|
||||
}
|
||||
|
||||
fun isMatch(query: String): Boolean {
|
||||
if (query.isEmpty()) {
|
||||
return true
|
||||
}
|
||||
|
||||
val lowercaseQuery = query.lowercase()
|
||||
val sortName = listOf(
|
||||
nickname.toString(),
|
||||
nickname.givenName,
|
||||
systemProfileName.toString(),
|
||||
systemProfileName.givenName,
|
||||
profileName.toString(),
|
||||
profileName.givenName,
|
||||
username.orElse("")
|
||||
).firstOrNull { it.isNotNullOrBlank() }?.lowercase()
|
||||
|
||||
return sortName?.contains(lowercaseQuery) == true ||
|
||||
e164.map { it.contains(query) }.orElse(false) ||
|
||||
email.map { it.contains(query) }.orElse(false)
|
||||
}
|
||||
|
||||
/** A full-length display name to render for this recipient. */
|
||||
fun getDisplayName(context: Context): String {
|
||||
var name = getNameFromLocalData(context)
|
||||
|
||||
Reference in New Issue
Block a user