From 2f7563767dc7214ec3c9a4d0c4d4b50e62c5927f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 21:04:49 +0400 Subject: [PATCH] Fix crash in archive / pinned in folder management. --- Telegram/SourceFiles/history/history.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index d1d0bcb43..fa69e0a9d 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -1948,12 +1948,6 @@ void History::setFolderPointer(Data::Folder *folder) { const auto wasInList = inChatList(); if (wasInList) { removeFromChatList(0, owner().chatsList(this->folder())); - for (const auto &filter : filters.list()) { - const auto id = filter.id(); - if (inChatList(id)) { - removeFromChatList(id, filters.chatsList(id)); - } - } } const auto was = _folder.value_or(nullptr); _folder = folder; @@ -1962,12 +1956,10 @@ void History::setFolderPointer(Data::Folder *folder) { } if (wasInList) { addToChatList(0, owner().chatsList(folder)); - for (const auto &filter : filters.list()) { - if (filter.contains(this)) { - const auto id = filter.id(); - addToChatList(id, filters.chatsList(id)); - } - } + + owner().chatsFilters().refreshHistory(this); + updateChatListEntry(); + owner().chatsListChanged(was); owner().chatsListChanged(folder); } else if (!wasKnown) {