From 8bb47e505a9760b1f80f44bf586fde8e89a43900 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:33:03 +0000 Subject: [PATCH] android, desktop, ios: scope media support-message preview to pending invitee only The prior change to render caption-less media (instead of the status text) used the shared ChatPreviewView condition, so it affected every chat with a status preview (direct connection states, other group states). Gate it on memberPending so only the pending invitee's member-support preview changes; all other chats keep the original hasMsgContent behaviour. --- apps/ios/Shared/Views/ChatList/ChatPreviewView.swift | 7 ++++--- .../chat/simplex/common/views/chatlist/ChatPreviewView.kt | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatPreviewView.swift b/apps/ios/Shared/Views/ChatList/ChatPreviewView.swift index 57e21c227a..c3fa44dce1 100644 --- a/apps/ios/Shared/Views/ChatList/ChatPreviewView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatPreviewView.swift @@ -347,12 +347,13 @@ struct ChatPreviewView: View { } @ViewBuilder private func chatMessagePreview(_ cItem: ChatItem?, _ hasFilePreview: Bool = false) -> some View { + // pending invitee only: a member-support message (incl. caption-less media) renders its content, + // not the "reviewed by admins" status; other chats keep the original no-text behaviour + let previewHasNoContent = chat.chatInfo.groupInfo?.membership.memberPending ?? false ? cItem?.content.msgContent == nil : cItem?.content.hasMsgContent != true if chatModel.draftChatId == chat.id, let draft = chatModel.draft { let (t, hasSecrets) = messageDraft(draft) chatPreviewLayout(t, draft: true, hasFilePreview: hasFilePreview, hasSecrets: hasSecrets) - } else if cItem?.content.msgContent == nil, let previewText = chatPreviewInfoText() { - // status text only for no-content events; any message (incl. caption-less media) renders - // its content (thumbnail shown separately) - e.g. a pending invitee's photo shows "image" + } else if previewHasNoContent, let previewText = chatPreviewInfoText() { chatPreviewInfoTextLayout(previewText) } else if let cItem = cItem { let (t, hasSecrets) = chatItemPreview(cItem) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatPreviewView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatPreviewView.kt index 5c6aa2e4d3..6106be37db 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatPreviewView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatPreviewView.kt @@ -218,6 +218,9 @@ fun ChatPreviewView( fun chatPreviewText() { val previewText = chatPreviewInfoText() val ci = chat.chatItems.lastOrNull() + // pending invitee only: a member-support message (incl. caption-less media) renders its content, not + // the "reviewed by admins" status; other chats keep the original no-text behaviour + val previewHasNoContent = if (cInfo.groupInfo_?.membership?.memberPending == true) ci?.content?.msgContent == null else ci?.content?.hasMsgContent != true if (chatModelDraftChatId == chat.id && chatModelDraft != null) { val sp20 = with(LocalDensity.current) { 20.sp.toDp() } val (text: CharSequence, inlineTextContent) = remember(chatModelDraft) { chatModelDraft.message.text to messageDraft(chatModelDraft, sp20) } @@ -238,9 +241,7 @@ fun ChatPreviewView( inlineContent = inlineTextContent, modifier = Modifier.fillMaxWidth() ) - } else if (ci?.content?.msgContent == null && previewText != null) { - // status text only for no-content events; any message (incl. caption-less media) renders its - // content (thumbnail shown separately) - e.g. a pending invitee's photo shows "image", not the status + } else if (previewHasNoContent && previewText != null) { Text(previewText.first, color = previewText.second) } else if (ci != null && showChatPreviews) { val (text: CharSequence, inlineTextContent) = when {