From f6b786a187f52a44b70cb70e8ad6a5c26d38277e Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:31:35 +0400 Subject: [PATCH] get user index by remote host id --- .../commonMain/kotlin/chat/simplex/common/model/ChatModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index 179a4e846..660e7de15 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -122,7 +122,7 @@ object ChatModel { } private fun getUserIndex(user: User): Int = - users.indexOfFirst { it.user.userId == user.userId } + users.indexOfFirst { it.user.userId == user.userId && it.user.remoteHostId == user.remoteHostId } fun updateUser(user: User) { val i = getUserIndex(user)