mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-12 16:09:00 +00:00
8b93c226d4
When a member support chat or group reports view is open (a secondary chats context is active), incoming messages could overwrite the last-message preview of an unrelated chat in the main chat list, increment the wrong chat's unread badge, and pop the wrong chat to the top. ChatsContext.addChatItem computed the chat index against the receiver context's own list via getChatIndex, but then read/wrote chatsContext.chats[i], which always refers to the primary (main) chat list. On the secondary context the two lists are ordered differently, so the index pointed at a different chat. Use the receiver context's own list (chats[i]) consistently, matching every other method in ChatsContext and the iOS implementation. No change for the primary context, where chats and chatsContext.chats are the same list.