diff --git a/CMakeLists.txt b/CMakeLists.txt index eeb6b3ad0..f159efe0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1020,6 +1020,7 @@ set(TDLIB_SOURCE_PART2 td/telegram/StoryInteractionInfo.hpp td/telegram/StoryStealthMode.hpp td/telegram/SuggestedAction.hpp + td/telegram/TermsOfService.hpp td/telegram/ThemeSettings.hpp td/telegram/TranscriptionInfo.hpp td/telegram/VideoNotesManager.hpp diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp index 4ae3e4c09..9eb3f6d07 100644 --- a/td/telegram/AuthManager.cpp +++ b/td/telegram/AuthManager.cpp @@ -28,6 +28,7 @@ #include "td/telegram/Td.h" #include "td/telegram/TdDb.h" #include "td/telegram/telegram_api.h" +#include "td/telegram/TermsOfService.hpp" #include "td/telegram/TermsOfServiceManager.h" #include "td/telegram/ThemeManager.h" #include "td/telegram/TopDialogManager.h" diff --git a/td/telegram/TermsOfService.h b/td/telegram/TermsOfService.h index ad80c83fe..eaca92b56 100644 --- a/td/telegram/TermsOfService.h +++ b/td/telegram/TermsOfService.h @@ -7,7 +7,6 @@ #pragma once #include "td/telegram/MessageEntity.h" -#include "td/telegram/MessageEntity.hpp" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" @@ -33,26 +32,10 @@ class TermsOfService { td_api::object_ptr get_terms_of_service_object() const; template - void store(StorerT &storer) const { - using td::store; - BEGIN_STORE_FLAGS(); - STORE_FLAG(show_popup_); - END_STORE_FLAGS(); - store(id_, storer); - store(text_, storer); - store(min_user_age_, storer); - } + void store(StorerT &storer) const; template - void parse(ParserT &parser) { - using td::parse; - BEGIN_PARSE_FLAGS(); - PARSE_FLAG(show_popup_); - END_PARSE_FLAGS(); - parse(id_, parser); - parse(text_, parser); - parse(min_user_age_, parser); - } + void parse(ParserT &parser); }; } // namespace td diff --git a/td/telegram/TermsOfService.hpp b/td/telegram/TermsOfService.hpp new file mode 100644 index 000000000..d4f139f11 --- /dev/null +++ b/td/telegram/TermsOfService.hpp @@ -0,0 +1,39 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/TermsOfService.h" + +#include "td/telegram/MessageEntity.hpp" + +#include "td/utils/common.h" + +namespace td { + +template +void TermsOfService::store(StorerT &storer) const { + using td::store; + BEGIN_STORE_FLAGS(); + STORE_FLAG(show_popup_); + END_STORE_FLAGS(); + store(id_, storer); + store(text_, storer); + store(min_user_age_, storer); +} + +template +void TermsOfService::parse(ParserT &parser) { + using td::parse; + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(show_popup_); + END_PARSE_FLAGS(); + parse(id_, parser); + parse(text_, parser); + parse(min_user_age_, parser); +} + +} // namespace td