From 37e754390048697fedb4c2ff23e55b6a259e19f8 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 21 Apr 2019 20:57:49 +0300 Subject: [PATCH] Fix processing secret chats binlog events. GitOrigin-RevId: 86376ea62b45a00b731e78b42f3af375384c2879 --- td/telegram/SecretChatsManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/td/telegram/SecretChatsManager.cpp b/td/telegram/SecretChatsManager.cpp index 7140e1c3..ab26b775 100644 --- a/td/telegram/SecretChatsManager.cpp +++ b/td/telegram/SecretChatsManager.cpp @@ -27,6 +27,7 @@ #include "td/actor/PromiseFuture.h" #include "td/db/binlog/BinlogEvent.h" +#include "td/db/binlog/BinlogHelper.h" #include "td/db/binlog/BinlogInterface.h" #include "td/utils/common.h" @@ -294,6 +295,10 @@ Promise<> SecretChatsManager::add_qts(int32 qts) { } void SecretChatsManager::replay_binlog_event(BinlogEvent &&binlog_event) { + if (dummy_mode_) { + binlog_erase(G()->td_db()->get_binlog(), binlog_event.id_); + return; + } auto r_message = logevent::SecretChatEvent::from_buffer_slice(binlog_event.data_as_buffer_slice()); LOG_IF(FATAL, r_message.is_error()) << "Failed to deserialize event: " << r_message.error(); auto message = r_message.move_as_ok();