2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Fix local history clearing.

This commit is contained in:
John Preston
2019-04-08 13:16:45 +04:00
parent f980023f49
commit fb244c00b9
9 changed files with 84 additions and 96 deletions

View File

@@ -167,7 +167,7 @@ void Session::clear() {
_sendActions.clear();
for (const auto &[peerId, history] : _histories) {
history->unloadBlocks();
history->clear(History::ClearType::Unload);
}
App::historyClearMsgs();
_histories.clear();
@@ -727,7 +727,9 @@ void Session::deleteConversationLocally(not_null<PeerData*> peer) {
if (history) {
setPinnedDialog(history, false);
App::main()->removeDialog(history);
history->clear();
history->clear(peer->isChannel()
? History::ClearType::Unload
: History::ClearType::DeleteChat);
}
if (const auto channel = peer->asMegagroup()) {
channel->addFlags(MTPDchannel::Flag::f_left);
@@ -736,8 +738,6 @@ void Session::deleteConversationLocally(not_null<PeerData*> peer) {
migrated->updateChatListExistence();
}
}
} else if (history) {
history->markFullyLoaded();
}
}