Add Chat.accent_color_id.

This commit is contained in:
levlam 2023-11-13 19:08:21 +03:00 committed by David Guillen Fandos
parent 0da8d14430
commit a2a226ac42
2 changed files with 11 additions and 0 deletions

View File

@ -971,6 +971,8 @@ class Client::JsonChat final : public td::Jsonable {
if (chat_info->message_auto_delete_time != 0) { if (chat_info->message_auto_delete_time != 0) {
object("message_auto_delete_time", chat_info->message_auto_delete_time); 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) { if (chat_info->has_protected_content) {
object("has_protected_content", td::JsonTrue()); object("has_protected_content", td::JsonTrue());
} }
@ -5945,6 +5947,7 @@ void Client::on_update(object_ptr<td_api::Object> result) {
chat_info->photo_info = std::move(chat->photo_); chat_info->photo_info = std::move(chat->photo_);
chat_info->permissions = std::move(chat->permissions_); chat_info->permissions = std::move(chat->permissions_);
chat_info->message_auto_delete_time = chat->message_auto_delete_time_; 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_; chat_info->has_protected_content = chat->has_protected_content_;
break; break;
} }
@ -5976,6 +5979,13 @@ void Client::on_update(object_ptr<td_api::Object> result) {
chat_info->message_auto_delete_time = update->message_auto_delete_time_; chat_info->message_auto_delete_time = update->message_auto_delete_time_;
break; break;
} }
case td_api::updateChatAccentColor::ID: {
auto update = move_object_as<td_api::updateChatAccentColor>(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: { case td_api::updateChatHasProtectedContent::ID: {
auto update = move_object_as<td_api::updateChatHasProtectedContent>(result); auto update = move_object_as<td_api::updateChatHasProtectedContent>(result);
auto chat_info = add_chat(update->chat_id_); auto chat_info = add_chat(update->chat_id_);

View File

@ -891,6 +891,7 @@ class Client final : public WebhookActor::Callback {
Type type = Type::Unknown; Type type = Type::Unknown;
td::string title; td::string title;
int32 message_auto_delete_time = 0; int32 message_auto_delete_time = 0;
int32 accent_color_id = -1;
bool has_protected_content = false; bool has_protected_content = false;
object_ptr<td_api::chatPhotoInfo> photo_info; object_ptr<td_api::chatPhotoInfo> photo_info;
object_ptr<td_api::chatPermissions> permissions; object_ptr<td_api::chatPermissions> permissions;