Files
simplex-chat/apps/multiplatform/common
Narasimha-sc 8b93c226d4 android, desktop: fix message preview and unread count applied to the wrong chat
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.
2026-06-13 10:45:42 +00:00
..