Fix crash in archive / pinned in folder management.

This commit is contained in:
John Preston 2020-03-30 21:04:49 +04:00
parent f4822cf558
commit 2f7563767d
1 changed files with 4 additions and 12 deletions

View File

@ -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) {