// // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021 // // 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/ChannelId.h" #include "td/telegram/DialogId.h" #include "td/telegram/MessageId.h" #include "td/telegram/MinChannel.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/utils/common.h" #include "td/utils/StringBuilder.h" #include namespace td { class Td; struct MessageReplyInfo { int32 reply_count = -1; int32 pts = -1; vector recent_replier_dialog_ids; // comments only vector> replier_min_channels; // comments only ChannelId channel_id; // comments only MessageId max_message_id; MessageId last_read_inbox_message_id; MessageId last_read_outbox_message_id; bool is_comment = false; static constexpr size_t MAX_RECENT_REPLIERS = 3; MessageReplyInfo() = default; MessageReplyInfo(Td *td, tl_object_ptr &&reply_info, bool is_bot); bool is_empty() const { return reply_count < 0; } bool need_update_to(const MessageReplyInfo &other) const; bool update_max_message_ids(MessageId other_max_message_id, MessageId other_last_read_inbox_message_id, MessageId other_last_read_outbox_message_id); bool update_max_message_ids(const MessageReplyInfo &other); bool add_reply(DialogId replier_dialog_id, MessageId reply_message_id, int diff); bool need_reget(const Td *td) const; td_api::object_ptr get_message_reply_info_object(Td *td) const; template void store(StorerT &storer) const; template void parse(ParserT &parser); }; StringBuilder &operator<<(StringBuilder &string_builder, const MessageReplyInfo &reply_info); } // namespace td