Commit Graph

12 Commits

Author SHA1 Message Date
John Preston 402cb0e668 Fix crash when removing folders with pinned chats.
ChatFilters::applyRemove() emptied the filter in the list and only then
detached its chats. Unpinning a chat re-caches its siblings' pinned
indices, which runs Session::refreshChatListEntry(); seeing the filter
still listed but emptied, it re-entered removeFromChatList() ->
setChatPinned() -> PinnedList::setPinned() on the same pinned list while
its re-cache loop iterated with a cached size, reading past the end of
the vector. This aborted on closing the Folders editor after removing
two or more folders that had pinned chats.

Detach the filter from the list before applyChange() tears down its
chats, so the re-entrant refresh no longer touches it. Also harden the
setPinned() re-cache loop to re-check the container size each iteration
as defense in depth.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 17:49:07 +04:00
gearonixx 5e1a05f12c Fix crash when removing pinned chats during folder changes. 2026-06-30 11:20:05 +04:00
John Preston 9f738cded2 Fix saved messages sublists pinning updates. 2024-02-01 12:37:34 +04:00
John Preston 37308cde21 Support dialog rows with variable height. 2022-11-22 00:26:48 +00:00
John Preston 8a288476b8 Implement pinned topics reordering. 2022-11-22 00:26:48 +00:00
John Preston 1f16ac59ca Try to fix a crash in pinned reordering. 2020-05-04 19:06:53 +04:00
John Preston 55900bbd3d Save pinned chats in filters to server. 2020-03-27 20:36:03 +04:00
John Preston e27a8fe058 Support pinned locally in filters. 2020-03-27 20:36:03 +04:00
John Preston 567bf60644 Use getters in MTP classes. 2019-07-05 16:23:07 +02:00
John Preston 6dd8f32f66 Fix build on Xcode. 2019-05-01 16:11:39 +04:00
John Preston 8fd811517b Count unread correctly in folders. 2019-05-01 16:11:37 +04:00
John Preston 58519300ea Support pinned chats in folders. 2019-05-01 16:11:37 +04:00