Fix binlog events applying order.

GitOrigin-RevId: f0e428a76e4ff0ff5f5ca99666710e0aa8ff2ee2
This commit is contained in:
levlam 2018-02-05 03:26:04 +03:00
parent 0968fafda6
commit 3146ccee03

View File

@ -4223,14 +4223,15 @@ Status Td::init(DbKey key) {
contacts_manager_->on_binlog_user_event(std::move(event)); contacts_manager_->on_binlog_user_event(std::move(event));
} }
for (auto &event : events.chat_events) {
contacts_manager_->on_binlog_chat_event(std::move(event));
}
for (auto &event : events.channel_events) { for (auto &event : events.channel_events) {
contacts_manager_->on_binlog_channel_event(std::move(event)); contacts_manager_->on_binlog_channel_event(std::move(event));
} }
// chats may contain links to channels, so should be inited after
for (auto &event : events.chat_events) {
contacts_manager_->on_binlog_chat_event(std::move(event));
}
for (auto &event : events.secret_chat_events) { for (auto &event : events.secret_chat_events) {
contacts_manager_->on_binlog_secret_chat_event(std::move(event)); contacts_manager_->on_binlog_secret_chat_event(std::move(event));
} }