From a2a226ac42f76a5caaae627e378023334fe51c3c Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 13 Nov 2023 19:08:21 +0300 Subject: [PATCH] Add Chat.accent_color_id. --- telegram-bot-api/Client.cpp | 10 ++++++++++ telegram-bot-api/Client.h | 1 + 2 files changed, 11 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index a86cf10..425be56 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -971,6 +971,8 @@ class Client::JsonChat final : public td::Jsonable { if (chat_info->message_auto_delete_time != 0) { object("message_auto_delete_time", chat_info->message_auto_delete_time); } + CHECK(chat_info->accent_color_id != -1); + object("accent_color_id", chat_info->accent_color_id); if (chat_info->has_protected_content) { object("has_protected_content", td::JsonTrue()); } @@ -5945,6 +5947,7 @@ void Client::on_update(object_ptr result) { chat_info->photo_info = std::move(chat->photo_); chat_info->permissions = std::move(chat->permissions_); chat_info->message_auto_delete_time = chat->message_auto_delete_time_; + chat_info->accent_color_id = chat->accent_color_id_; chat_info->has_protected_content = chat->has_protected_content_; break; } @@ -5976,6 +5979,13 @@ void Client::on_update(object_ptr result) { chat_info->message_auto_delete_time = update->message_auto_delete_time_; break; } + case td_api::updateChatAccentColor::ID: { + auto update = move_object_as(result); + auto chat_info = add_chat(update->chat_id_); + CHECK(chat_info->type != ChatInfo::Type::Unknown); + chat_info->accent_color_id = update->accent_color_id_; + break; + } case td_api::updateChatHasProtectedContent::ID: { auto update = move_object_as(result); auto chat_info = add_chat(update->chat_id_); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index a7089a7..7d06257 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -891,6 +891,7 @@ class Client final : public WebhookActor::Callback { Type type = Type::Unknown; td::string title; int32 message_auto_delete_time = 0; + int32 accent_color_id = -1; bool has_protected_content = false; object_ptr photo_info; object_ptr permissions;