From 4bb09ffd63ffe9d28d891b055da1f2d2ebab71fe Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 17 Feb 2021 15:45:24 +0300 Subject: [PATCH] Add message_auto_delete_time_changed service message. --- td | 2 +- telegram-bot-api/Client.cpp | 18 +++++++++++++++++- telegram-bot-api/Client.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/td b/td index db38757..3a657d9 160000 --- a/td +++ b/td @@ -1 +1 @@ -Subproject commit db3875710bcf9f29baa360d91d7b11b0199229a9 +Subproject commit 3a657d9072b324aad1143c6abe20a802f3b92cd5 diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 5dd25d5..b022706 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -1412,6 +1412,19 @@ class Client::JsonInviteVoiceChatParticipants : public Jsonable { const Client *client_; }; +class Client::JsonChatSetTtl : public Jsonable { + public: + explicit JsonChatSetTtl(const td_api::messageChatSetTtl *chat_set_ttl) : chat_set_ttl_(chat_set_ttl) { + } + void store(JsonValueScope *scope) const { + auto object = scope->enter_object(); + object("message_auto_delete_time", chat_set_ttl_->ttl_); + } + + private: + const td_api::messageChatSetTtl *chat_set_ttl_; +}; + class Client::JsonCallbackGame : public Jsonable { public: void store(JsonValueScope *scope) const { @@ -1752,8 +1765,11 @@ void Client::JsonMessage::store(JsonValueScope *scope) const { break; case td_api::messageScreenshotTaken::ID: break; - case td_api::messageChatSetTtl::ID: + case td_api::messageChatSetTtl::ID: { + auto content = static_cast(message_->content.get()); + object("message_auto_delete_time_changed", JsonChatSetTtl(content)); break; + } case td_api::messageUnsupported::ID: break; case td_api::messageContactRegistered::ID: diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index adc28db..b4be0b8 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -146,6 +146,7 @@ class Client : public WebhookActor::Callback { class JsonVoiceChatStarted; class JsonVoiceChatEnded; class JsonInviteVoiceChatParticipants; + class JsonChatSetTtl; class JsonUpdateTypes; class JsonWebhookInfo; class JsonStickerSet;