// // 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/MessageEntity.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/utils/common.h" namespace td { class Dependencies; class Td; class FactCheck { string country_code_; FormattedText text_; int64 hash_ = 0; bool need_check_ = false; friend bool operator==(const unique_ptr &lhs, const unique_ptr &rhs); public: FactCheck() = default; FactCheck(const FactCheck &) = delete; FactCheck &operator=(const FactCheck &) = delete; FactCheck(FactCheck &&) = default; FactCheck &operator=(FactCheck &&) = default; ~FactCheck(); static unique_ptr get_fact_check(Td *td, telegram_api::object_ptr &&fact_check, bool is_bot); bool is_empty() const { return hash_ == 0; } bool need_check() const { return need_check_; } void update_from(const FactCheck &old_fact_check); void add_dependencies(Dependencies &dependencies) const; td_api::object_ptr get_fact_check_object() const; template void store(StorerT &storer) const; template void parse(ParserT &parser); }; bool operator==(const unique_ptr &lhs, const unique_ptr &rhs); bool operator!=(const unique_ptr &lhs, const unique_ptr &rhs); } // namespace td