From 862d93c6476f327368c0f1967f75cf44560508d1 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 18 Jun 2026 10:07:43 +0000 Subject: [PATCH] android, desktop: keep sent support message in main chat preview for pending invitee A message sent in a secondary scope (member support / "chat with admins") is added only to the active context (ComposeView passes its own chatsCtx), unlike received items which the NewChatItems handler delivers to both the primary and secondary contexts. After the index-correct revert of #5909's chatsContext.chats[i] write, a pending invitee's sent support message no longer appeared in the main chat list preview. Mirror the receive path: when adding a sent item on a secondary context, also update the primary context, so the main chat list preview updates at the correct index. Sent items are not RcvNew, so this adds no unread double-count. --- .../commonMain/kotlin/chat/simplex/common/model/ChatModel.kt | 5 +++++ 1 file changed, 5 insertions(+) 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 1410d520b8..7fdf82176c 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,6 +520,11 @@ 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) { + chatsContext.addChatItem(rhId, chatInfo, cItem) + } // updates membersRequireAttention val cInfo = if (chatInfo is ChatInfo.Direct && chatInfo.chatDeleted) { // mark chat non deleted