From cb4b1b7f5070af0f4c8fe0ef6f7a5c7ccb0b1075 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:52:11 +0000 Subject: [PATCH] android, desktop, ios: let caption-less media become the pending invitee preview The prefer-content check used hasMsgContent (msgContent != null AND non-empty text), so a caption-less photo/voice/file was treated like a no-content event and could not become the preview when a prior text message was shown. Use msgContent != null (is-a-message) instead; the no-content event re-cover guard still holds (events have msgContent == null). --- apps/ios/Shared/Model/ChatModel.swift | 2 +- .../commonMain/kotlin/chat/simplex/common/model/ChatModel.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ios/Shared/Model/ChatModel.swift b/apps/ios/Shared/Model/ChatModel.swift index 51c7d6d182..7a46c8764f 100644 --- a/apps/ios/Shared/Model/ChatModel.swift +++ b/apps/ios/Shared/Model/ChatModel.swift @@ -664,7 +664,7 @@ final class ChatModel: ObservableObject { // Pending invitee: surface the latest support message (broker vs local itemTs // aren't comparable); don't let a no-content event re-cover an already-shown message. if cInfo.groupInfo?.membership.memberPending ?? false { - (cItem.content.hasMsgContent || !currentPreviewItem.content.hasMsgContent) ? [cItem] : [currentPreviewItem] + (cItem.content.msgContent != nil || currentPreviewItem.content.msgContent == nil) ? [cItem] : [currentPreviewItem] } else if cItem.meta.itemTs >= currentPreviewItem.meta.itemTs { [cItem] } else { 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 2a5bd29e31..8a953ca4f0 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 @@ -548,7 +548,7 @@ object ChatModel { // Pending invitee: surface the latest support message (broker vs local itemTs aren't // comparable); don't let a no-content event re-cover an already-shown message. if (cInfo.groupInfo_?.membership?.memberPending == true) { - if (cItem.content.hasMsgContent || !currentPreviewItem.content.hasMsgContent) cItem else currentPreviewItem + if (cItem.content.msgContent != null || currentPreviewItem.content.msgContent == null) cItem else currentPreviewItem } else if (cItem.meta.itemTs >= currentPreviewItem.meta.itemTs) { cItem } else {