diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 9a3c2a134..accea57ae 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -13,6 +13,7 @@ #include "td/actor/PromiseFuture.h" #include "td/actor/SleepActor.h" +#include "td/db/binlog/BinlogEvent.h" #include "td/db/binlog/BinlogHelper.h" #include "td/db/SqliteKeyValueAsync.h" diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 45119ab5a..a8fe17782 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -9,13 +9,6 @@ #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" -#include "td/actor/actor.h" -#include "td/actor/MultiPromise.h" -#include "td/actor/PromiseFuture.h" -#include "td/actor/Timeout.h" - -#include "td/db/binlog/BinlogEvent.h" - #include "td/telegram/AccessRights.h" #include "td/telegram/ChannelId.h" #include "td/telegram/ChatId.h" @@ -28,6 +21,11 @@ #include "td/telegram/SecretChatId.h" #include "td/telegram/UserId.h" +#include "td/actor/actor.h" +#include "td/actor/MultiPromise.h" +#include "td/actor/PromiseFuture.h" +#include "td/actor/Timeout.h" + #include "td/utils/common.h" #include "td/utils/Hints.h" #include "td/utils/Slice.h" @@ -41,6 +39,8 @@ namespace td { +struct BinlogEvent; + class Td; struct BotData { diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 99c713860..df67d47ba 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -47,6 +47,7 @@ #include "td/actor/PromiseFuture.h" #include "td/actor/SleepActor.h" +#include "td/db/binlog/BinlogEvent.h" #include "td/db/binlog/BinlogHelper.h" #include "td/db/SqliteKeyValueAsync.h" diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 168e23b48..16e0b9c65 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -34,8 +34,6 @@ #include "td/telegram/SecretInputMedia.h" #include "td/telegram/UserId.h" -#include "td/db/binlog/BinlogEvent.h" - #include "td/actor/actor.h" #include "td/actor/MultiPromise.h" #include "td/actor/PromiseFuture.h" @@ -63,6 +61,8 @@ namespace td { +struct BinlogEvent; + class Td; class MultiSequenceDispatcher; diff --git a/td/telegram/SecretChatsManager.cpp b/td/telegram/SecretChatsManager.cpp index 09f5d22fd..e915c5f62 100644 --- a/td/telegram/SecretChatsManager.cpp +++ b/td/telegram/SecretChatsManager.cpp @@ -6,8 +6,6 @@ // #include "td/telegram/SecretChatsManager.h" -#include "td/actor/PromiseFuture.h" - #include "td/telegram/ConfigShared.h" #include "td/telegram/ContactsManager.h" #include "td/telegram/DhCache.h" @@ -22,6 +20,10 @@ #include "td/telegram/secret_api.h" #include "td/telegram/telegram_api.hpp" +#include "td/actor/PromiseFuture.h" + +#include "td/db/binlog/BinlogEvent.h" + #include "td/utils/format.h" #include "td/utils/logging.h" #include "td/utils/misc.h" diff --git a/td/telegram/SecretChatsManager.h b/td/telegram/SecretChatsManager.h index 503090348..dee976daa 100644 --- a/td/telegram/SecretChatsManager.h +++ b/td/telegram/SecretChatsManager.h @@ -17,14 +17,15 @@ #include "td/actor/actor.h" #include "td/actor/PromiseFuture.h" -#include "td/db/binlog/BinlogEvent.h" - #include "td/utils/Time.h" #include #include namespace td { + +struct BinlogEvent; + class SecretChatsManager : public Actor { public: explicit SecretChatsManager(ActorShared<> parent); diff --git a/td/telegram/TdDb.h b/td/telegram/TdDb.h index 7e7f7184e..681361670 100644 --- a/td/telegram/TdDb.h +++ b/td/telegram/TdDb.h @@ -50,11 +50,6 @@ class TdDb { TdDb &operator=(TdDb &&) = delete; ~TdDb(); - struct Events; - static Result> open(int32 scheduler_id, const TdParameters ¶meters, DbKey key, Events &events); - static Result check_encryption(const TdParameters ¶meters); - static Status destroy(const TdParameters ¶meters); - struct Events { vector to_secret_chats_manager; vector user_events; @@ -65,6 +60,10 @@ class TdDb { vector to_messages_manager; }; + static Result> open(int32 scheduler_id, const TdParameters ¶meters, DbKey key, Events &events); + static Result check_encryption(const TdParameters ¶meters); + static Status destroy(const TdParameters ¶meters); + std::shared_ptr get_file_db_shared(); std::shared_ptr &get_sqlite_connection_safe(); ConcurrentBinlog *get_binlog(); diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 1375e268a..a5c0285ee 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -38,6 +38,7 @@ #include "td/actor/PromiseFuture.h" +#include "td/db/binlog/BinlogEvent.h" #include "td/db/binlog/BinlogHelper.h" #include "td/db/SqliteKeyValueAsync.h" diff --git a/td/telegram/WebPagesManager.h b/td/telegram/WebPagesManager.h index 7abcd0b16..ac4ce2d52 100644 --- a/td/telegram/WebPagesManager.h +++ b/td/telegram/WebPagesManager.h @@ -19,8 +19,6 @@ #include "td/actor/PromiseFuture.h" #include "td/actor/Timeout.h" -#include "td/db/binlog/BinlogEvent.h" - #include "td/utils/common.h" #include "td/utils/Status.h" @@ -30,6 +28,8 @@ namespace td { +struct BinlogEvent; + class Td; class WebPagesManager : public Actor { diff --git a/tddb/td/db/binlog/BinlogHelper.h b/tddb/td/db/binlog/BinlogHelper.h index 3e53a7221..78ea564d6 100644 --- a/tddb/td/db/binlog/BinlogHelper.h +++ b/tddb/td/db/binlog/BinlogHelper.h @@ -14,6 +14,7 @@ #include "td/utils/Storer.h" namespace td { + template uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, Promise<> promise = Promise<>()) { auto logevent_id = binlog_ptr->next_id(); @@ -42,4 +43,5 @@ uint64 binlog_erase_impl(BinlogDebugInfo info, const BinlogT &binlog_ptr, uint64 std::move(promise)); return seq_no; } + } // namespace td