2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Prepare code for revoking of full history.

This commit is contained in:
John Preston
2019-03-21 16:07:32 +04:00
parent 2701e63406
commit dd8c526fb7
9 changed files with 111 additions and 162 deletions

View File

@@ -4473,16 +4473,11 @@ void HistoryWidget::onReportSpamClear() {
Expects(_peer != nullptr);
InvokeQueued(App::main(), [peer = _peer] {
if (peer->isUser()) {
App::main()->deleteConversation(peer);
} else if (auto chat = peer->asChat()) {
App::main()->deleteAndExit(chat);
} else if (auto channel = peer->asChannel()) {
if (channel->migrateFrom()) {
App::main()->deleteConversation(channel->migrateFrom());
}
Auth().api().leaveChannel(channel);
Ui::showChatsList();
if (const auto from = peer->migrateFrom()) {
peer->session().api().deleteConversation(from, false);
}
peer->session().api().deleteConversation(peer, false);
});
// Invalidates _peer.