Add temporary binlog fix.

GitOrigin-RevId: bf91645a6646f39fdbd36ac1351fdce2ae5b7763
This commit is contained in:
levlam 2018-10-28 18:21:35 +03:00
parent 34f5f96afd
commit 6a402ee0a3

View File

@ -5417,6 +5417,11 @@ void ContactsManager::on_binlog_chat_event(BinlogEvent &&event) {
auto chat_id = log_event.chat_id;
LOG(INFO) << "Add " << chat_id << " from binlog";
Chat *c = add_chat(chat_id);
if (c->left || !c->kicked) {
LOG(ERROR) << "Skip adding already added " << chat_id;
binlog_erase(G()->td_db()->get_binlog(), event.id_);
return; // TODO fix bug in Binlog and remove that fix
}
CHECK(!c->left && c->kicked);
*c = std::move(log_event.c); // chats come from binlog before all other events, so just add them