Process updateFolderPeers before new messages.

GitOrigin-RevId: 53baf318d3bf1d1f356a47cb89c2bb4e61880fc2
This commit is contained in:
levlam 2019-09-15 04:59:22 +03:00
parent 003aee4268
commit eddbbe0d42

View File

@ -946,6 +946,11 @@ void UpdatesManager::process_get_difference_updates(
CHECK(!running_get_difference_); CHECK(!running_get_difference_);
} }
if (constructor_id == telegram_api::updateFolderPeers::ID) {
on_update(move_tl_object_as<telegram_api::updateFolderPeers>(update), true);
CHECK(!running_get_difference_);
}
/* /*
// TODO can't apply it here, because dialog may not be created yet // TODO can't apply it here, because dialog may not be created yet
// process updateReadHistoryInbox before new messages // process updateReadHistoryInbox before new messages
@ -1185,8 +1190,13 @@ void UpdatesManager::on_pending_updates(vector<tl_object_ptr<telegram_api::Updat
} }
processed_updates++; processed_updates++;
update = nullptr; update = nullptr;
CHECK(!running_get_difference_);
} }
if (id == telegram_api::updateFolderPeers::ID) {
on_update(move_tl_object_as<telegram_api::updateFolderPeers>(update), false);
processed_updates++;
update = nullptr;
}
CHECK(!running_get_difference_);
} }
} }
@ -1196,7 +1206,7 @@ void UpdatesManager::on_pending_updates(vector<tl_object_ptr<telegram_api::Updat
if (id == telegram_api::updateNewMessage::ID || id == telegram_api::updateReadMessagesContents::ID || if (id == telegram_api::updateNewMessage::ID || id == telegram_api::updateReadMessagesContents::ID ||
id == telegram_api::updateEditMessage::ID || id == telegram_api::updateDeleteMessages::ID || id == telegram_api::updateEditMessage::ID || id == telegram_api::updateDeleteMessages::ID ||
id == telegram_api::updateReadHistoryInbox::ID || id == telegram_api::updateReadHistoryOutbox::ID || id == telegram_api::updateReadHistoryInbox::ID || id == telegram_api::updateReadHistoryOutbox::ID ||
id == telegram_api::updateWebPage::ID || id == telegram_api::updateFolderPeers::ID) { id == telegram_api::updateWebPage::ID) {
if (!downcast_call(*update, OnUpdate(this, update, false))) { if (!downcast_call(*update, OnUpdate(this, update, false))) {
LOG(ERROR) << "Can't call on some update received from " << source; LOG(ERROR) << "Can't call on some update received from " << source;
} }