From af028f14ed42d721cbb484142f4670af44190320 Mon Sep 17 00:00:00 2001 From: Diogo Date: Wed, 4 Sep 2024 17:21:41 +0100 Subject: [PATCH] multiplatform: fix deleted contacts with conversations being identified as contact cards --- .../chat/simplex/common/views/chatlist/ChatListNavLinkView.kt | 2 +- .../kotlin/chat/simplex/common/views/newchat/NewChatSheet.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt index e39adcca3b..50a1d75341 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt @@ -186,7 +186,7 @@ fun ErrorChatListItem() { suspend fun directChatAction(rhId: Long?, contact: Contact, chatModel: ChatModel) { when { - contact.activeConn == null && contact.profile.contactLink != null -> askCurrentOrIncognitoProfileConnectContactViaAddress(chatModel, rhId, contact, close = null, openChat = true) + contact.activeConn == null && contact.profile.contactLink != null && contact.contactStatus == ContactStatus.Active -> askCurrentOrIncognitoProfileConnectContactViaAddress(chatModel, rhId, contact, close = null, openChat = true) else -> openChat(rhId, ChatInfo.Direct(contact), chatModel) } } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/NewChatSheet.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/NewChatSheet.kt index 7a9fec100d..6eb18f53de 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/NewChatSheet.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/NewChatSheet.kt @@ -99,7 +99,7 @@ fun chatContactType(chat: Chat): ContactType { val contact = cInfo.contact when { - contact.activeConn == null && contact.profile.contactLink != null -> ContactType.CARD + contact.activeConn == null && contact.profile.contactLink != null && contact.contactStatus == ContactStatus.Active -> ContactType.CARD contact.chatDeleted -> ContactType.CHAT_DELETED contact.contactStatus == ContactStatus.Active -> ContactType.RECENT else -> ContactType.UNLISTED