diff --git a/td/telegram/ForumTopic.cpp b/td/telegram/ForumTopic.cpp index d1b96d93d..79e44cf84 100644 --- a/td/telegram/ForumTopic.cpp +++ b/td/telegram/ForumTopic.cpp @@ -7,6 +7,7 @@ #include "td/telegram/ForumTopic.h" #include "td/telegram/DraftMessage.h" +#include "td/telegram/ForumTopicInfo.h" #include "td/telegram/ServerMessageId.h" #include "td/telegram/Td.h" @@ -20,7 +21,6 @@ ForumTopic::ForumTopic(Td *td, tl_object_ptr &&forum_t LOG(INFO) << "Receive " << to_string(forum_topic_ptr); return; } - info_ = ForumTopicInfo(forum_topic_ptr); auto *forum_topic = static_cast(forum_topic_ptr.get()); is_short_ = forum_topic->short_; if (is_short_) { @@ -40,8 +40,8 @@ ForumTopic::ForumTopic(Td *td, tl_object_ptr &&forum_t draft_message_ = get_draft_message(td->contacts_manager_.get(), std::move(forum_topic->draft_)); } -td_api::object_ptr ForumTopic::get_forum_topic_object(Td *td) const { - if (is_empty()) { +td_api::object_ptr ForumTopic::get_forum_topic_object(Td *td, const ForumTopicInfo &info) const { + if (info.is_empty()) { return nullptr; } @@ -49,7 +49,7 @@ td_api::object_ptr ForumTopic::get_forum_topic_object(Td *td // TODO last_message auto draft_message = get_draft_message_object(draft_message_); return td_api::make_object( - info_.get_forum_topic_info_object(td), nullptr, is_pinned_, unread_count_, last_read_inbox_message_id_.get(), + info.get_forum_topic_info_object(td), nullptr, is_pinned_, unread_count_, last_read_inbox_message_id_.get(), last_read_outbox_message_id_.get(), unread_mention_count_, unread_reaction_count_, get_chat_notification_settings_object(¬ification_settings_), std::move(draft_message)); } diff --git a/td/telegram/ForumTopic.h b/td/telegram/ForumTopic.h index 3d42dcdfe..601251313 100644 --- a/td/telegram/ForumTopic.h +++ b/td/telegram/ForumTopic.h @@ -7,7 +7,6 @@ #pragma once #include "td/telegram/DialogNotificationSettings.h" -#include "td/telegram/ForumTopicInfo.h" #include "td/telegram/MessageId.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" @@ -17,10 +16,10 @@ namespace td { class DraftMessage; +class ForumTopicInfo; class Td; class ForumTopic { - ForumTopicInfo info_; bool is_short_ = false; bool is_pinned_ = false; bool is_hidden_ = false; @@ -38,15 +37,11 @@ class ForumTopic { ForumTopic(Td *td, tl_object_ptr &&forum_topic_ptr); - bool is_empty() const { - return info_.is_empty(); + bool is_short() const { + return is_short_; } - MessageId get_top_thread_message_id() const { - return info_.get_top_thread_message_id(); - } - - td_api::object_ptr get_forum_topic_object(Td *td) const; + td_api::object_ptr get_forum_topic_object(Td *td, const ForumTopicInfo &info) const; }; } // namespace td