From bd7c6c3e8529bccd2fc058bc440aa1224159fe38 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:05:56 +0000 Subject: [PATCH] android, desktop: show pending invitee's received support messages in chat list preview - Narrow the sent-item mirror (previous commit) to GroupChatScopeContext (member support); the reports view has no compose, so it shouldn't trigger it. - A pending invitee's RECEIVED support message was dropped from the main chat list preview: the group preview keeps the higher-itemTs item, but a received message's itemTs is the broker clock while the placeholder group event's itemTs is the local device clock - an unreliable cross-clock comparison. Bypass it when memberPending so received support items surface in the preview the same way sent ones do. --- .../kotlin/chat/simplex/common/model/ChatModel.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 7fdf82176c..26e925791c 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 @@ -520,9 +520,10 @@ object ChatModel { } suspend fun addChatItem(rhId: Long?, chatInfo: ChatInfo, cItem: ChatItem) { - // Sent items reach only the active context; received items reach both. Mirror that so a message - // sent in a secondary scope (member support) still updates the main chat list preview (#5909). - if (secondaryContextFilter != null && cItem.chatDir.sent) { + // A message sent in a member-support scope ("chat with admins") is added only to that secondary + // context; received items reach both. Mirror it so the send still updates the main chat list + // preview (e.g. a pending invitee's own message) - #5909. + if (secondaryContextFilter is SecondaryContextFilter.GroupChatScopeContext && cItem.chatDir.sent) { chatsContext.addChatItem(rhId, chatInfo, cItem) } // updates membersRequireAttention @@ -545,7 +546,11 @@ object ChatModel { is ChatInfo.Group -> { val currentPreviewItem = chat.chatItems.firstOrNull() if (currentPreviewItem != null) { - if (cItem.meta.itemTs >= currentPreviewItem.meta.itemTs) { + // For a pending invitee the support item (received via the broker clock) is the + // reason this preview updates; its itemTs isn't comparable to a locally-stamped + // group event, so always surface it rather than dropping it on a cross-clock check. + if (cInfo.groupInfo_?.membership?.memberPending == true || + cItem.meta.itemTs >= currentPreviewItem.meta.itemTs) { cItem } else { currentPreviewItem