mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-26 01:37:43 +00:00
Add name to Model.Contact to fix diffing in search as Contact.equals only checks accountId
This commit is contained in:
parent
afe1295289
commit
0992d12d71
@ -273,10 +273,10 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
|
||||
.flatMap { (key, contacts) ->
|
||||
listOf(
|
||||
GlobalSearchAdapter.Model.SubHeader(key)
|
||||
) + contacts.sortedBy { it.name ?: it.value.accountID }.map { it.value }.map { GlobalSearchAdapter.Model.Contact(it, it.accountID == publicKey) }
|
||||
) + contacts.sortedBy { it.name ?: it.value.accountID }.map { it.value }.map { GlobalSearchAdapter.Model.Contact(it, it.nickname ?: it.name, it.accountID == publicKey) }
|
||||
}
|
||||
} else {
|
||||
val contactAndGroupList = result.contacts.map { GlobalSearchAdapter.Model.Contact(it, it.accountID == publicKey) } +
|
||||
val contactAndGroupList = result.contacts.map { GlobalSearchAdapter.Model.Contact(it, it.nickname ?: it.name, it.accountID == publicKey) } +
|
||||
result.threads.map(GlobalSearchAdapter.Model::GroupConversation)
|
||||
|
||||
val contactResults = contactAndGroupList.toMutableList()
|
||||
|
@ -134,7 +134,7 @@ class GlobalSearchAdapter(private val modelCallback: (Model)->Unit): RecyclerVie
|
||||
constructor(title: String): this(GetString(title))
|
||||
}
|
||||
data class SavedMessages(val currentUserPublicKey: String): Model()
|
||||
data class Contact(val contact: ContactModel, val isSelf: Boolean): Model()
|
||||
data class Contact(val contact: ContactModel, val name: String?, val isSelf: Boolean): Model()
|
||||
data class GroupConversation(val groupRecord: GroupRecord): Model()
|
||||
data class Message(val messageResult: MessageResult, val unread: Int, val isSelf: Boolean): Model()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user