From 3745632f68e69d15fcd7a1943699305f803018ac Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 10 Feb 2024 23:39:02 +0300 Subject: [PATCH] Support setChatEmojiStatus in supergroups. --- td/generate/scheme/td_api.tl | 3 ++- td/telegram/ContactsManager.cpp | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index e4b757107..c04883d63 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -8183,7 +8183,8 @@ setChatAccentColor chat_id:int53 accent_color_id:int32 background_custom_emoji_i //@description Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info administrator right //@chat_id Chat identifier -//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups or profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color +//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups +//-or profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color //@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set setChatProfileAccentColor chat_id:int53 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 1c7b43e5f..f1a133168 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -7290,7 +7290,7 @@ void ContactsManager::set_channel_profile_accent_color(ChannelId channel_id, Acc return promise.set_error(Status::Error(400, "Chat not found")); } if (!get_channel_status(c).can_change_info_and_settings()) { - return promise.set_error(Status::Error(400, "Not enough rights in the channel")); + return promise.set_error(Status::Error(400, "Not enough rights in the chat")); } td_->create_handler(std::move(promise)) @@ -7303,11 +7303,8 @@ void ContactsManager::set_channel_emoji_status(ChannelId channel_id, const Emoji if (c == nullptr) { return promise.set_error(Status::Error(400, "Chat not found")); } - if (c->is_megagroup) { - return promise.set_error(Status::Error(400, "Emoji status can be changed only in channel chats")); - } if (!get_channel_status(c).can_change_info_and_settings()) { - return promise.set_error(Status::Error(400, "Not enough rights in the channel")); + return promise.set_error(Status::Error(400, "Not enough rights in the chat")); } add_recent_emoji_status(td_, emoji_status);