2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-06 01:16:12 +00:00

Handle migration to supergroups in boxes.

This commit is contained in:
John Preston
2019-01-14 10:34:51 +04:00
parent 3c44bdb6b7
commit 9728ddeaf9
29 changed files with 426 additions and 231 deletions

View File

@@ -621,10 +621,6 @@ void MainWidget::notify_userIsBotChanged(UserData *bot) {
_history->notify_userIsBotChanged(bot);
}
void MainWidget::notify_migrateUpdated(PeerData *peer) {
_history->notify_migrateUpdated(peer);
}
void MainWidget::notify_historyMuteUpdated(History *history) {
_dialogs->notify_historyMuteUpdated(history);
}
@@ -874,7 +870,7 @@ void MainWidget::deleteConversation(
removeDialog(history);
if (const auto channel = peer->asMegagroup()) {
channel->addFlags(MTPDchannel::Flag::f_left);
if (const auto from = channel->mgInfo->migrateFromPtr) {
if (const auto from = channel->getMigrateFromChat()) {
if (const auto migrated = App::historyLoaded(from)) {
migrated->updateChatListExistence();
}
@@ -2832,15 +2828,17 @@ void MainWidget::searchInChat(Dialogs::Key chat) {
void MainWidget::feedUpdateVector(
const MTPVector<MTPUpdate> &updates,
bool skipMessageIds) {
for_const (auto &update, updates.v) {
if (skipMessageIds && update.type() == mtpc_updateMessageID) continue;
for (const auto &update : updates.v) {
if (skipMessageIds && update.type() == mtpc_updateMessageID) {
continue;
}
feedUpdate(update);
}
Auth().data().sendHistoryChangeNotifications();
}
void MainWidget::feedMessageIds(const MTPVector<MTPUpdate> &updates) {
for_const (auto &update, updates.v) {
for (const auto &update : updates.v) {
if (update.type() == mtpc_updateMessageID) {
feedUpdate(update);
}