Files
Narasimha-sc cc3f49f794 android, desktop: fix chat preview and unread counter updating wrong chat (#7072)
* android, desktop: fix chat preview and unread counter updating wrong chat

While "Chat with admins", a member support chat or the reports view was
open, ChatsContext.addChatItem in the secondary context looked up the
chat's index in its own list but read and wrote the main chat list at
that index (chatsContext.chats[i]), so an unrelated chat in the main
list got the message as its preview and its unread count went up.

Use the context's own list at all four sites again. The main-list
qualifier had also made a pending invitee's sent support messages reach
the group's preview in the main list (at a secondary-list index), so
send that update to the main list explicitly: addSentChatItem passes a
sent item to the main chat list context as well when it is sent from a
secondary view and belongs in the main list (inMainChatList, the same
rule addChatItem uses for previews). Count unread stats only in the
main chat list context, so the revert does not make the open secondary
view count main-list messages in its own list.

* plans: wrong-chat preview and unread fix
2026-10-21 22:36:34 +01:00
..
2026-10-21 14:35:41 +01:00