mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-27 17:58:47 +00:00
A member pending review has no main scope to write in, so their "chat with admins" messages are what the group's row in the chat list should show. Completes #5909 for messages the invitee sends, edits and deletes. Chat list: - previewItem picks the row's item: for a pending invitee a message is not replaced by a content-less event, and otherwise the later item wins. - ChatInfo.inMainChatList replaces the repeated scope/memberPending tests in addChatItem, upsertChatItem and removeChatItem, so edits, status changes and deletions of a support item reach the row that shows it. - addChatItem is split into addItemToChatList, previewItem and addItemToScope. - upsertChatItem tests "chat is in the list" and "chat may be added to the list" as separate branches - only a main scope chat can be added. Sent items reach only the active chats context, so ChatModel.addSentChatItem and upsertSentChatItem update the primary context as well when the active context is a support chat shown in the main list. Cross context dispatch stays with the caller, as in processReceivedMsg; no ChatsContext method touches the other context. Chat preview row shows the message instead of the "reviewed by admins" status when there is text, or content that is rendered without text (media without a caption), which needs previews to be enabled.