From f4b4ab3d74946ec46d3f7ce68fe483d9d9dd5802 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 31 Oct 2022 17:42:34 +0300 Subject: [PATCH] Add "forum_topic_closed"/"forum_topic_reopened" messages. --- telegram-bot-api/Client.cpp | 19 ++++++++++++++++--- telegram-bot-api/Client.h | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 8e1cc84..39ff34c 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -1364,6 +1364,13 @@ class Client::JsonForumTopicCreated final : public Jsonable { const td_api::messageForumTopicCreated *forum_topic_created_; }; +class Client::JsonForumTopicIsClosedToggled final : public Jsonable { + public: + void store(JsonValueScope *scope) const { + auto object = scope->enter_object(); + } +}; + class Client::JsonAddress final : public Jsonable { public: explicit JsonAddress(const td_api::address *address) : address_(address) { @@ -1983,8 +1990,15 @@ void Client::JsonMessage::store(JsonValueScope *scope) const { } case td_api::messageForumTopicEdited::ID: break; - case td_api::messageForumTopicIsClosedToggled::ID: + case td_api::messageForumTopicIsClosedToggled::ID: { + auto content = static_cast(message_->content.get()); + if (content->is_closed_) { + object("forum_topic_closed", JsonForumTopicIsClosedToggled()); + } else { + object("forum_topic_reopened", JsonForumTopicIsClosedToggled()); + } break; + } case td_api::messagePinMessage::ID: { auto content = static_cast(message_->content.get()); auto message_id = content->message_id_; @@ -9889,6 +9903,7 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr