Add disable sponsored messages boost feature.

This commit is contained in:
levlam 2024-04-02 14:49:26 +03:00
parent 67d42c5e14
commit 2bec18d95d
2 changed files with 9 additions and 5 deletions

View File

@ -3922,7 +3922,8 @@ publicForwards total_count:int32 forwards:vector<PublicForward> next_offset:stri
//@can_set_custom_background True, if custom background can be set in the chat for all users //@can_set_custom_background True, if custom background can be set in the chat for all users
//@can_set_custom_emoji_sticker_set True, if custom emoji sticker set can be set for the chat //@can_set_custom_emoji_sticker_set True, if custom emoji sticker set can be set for the chat
//@can_recognize_speech True, if speech recognition can be used for video note and voice note messages by all users //@can_recognize_speech True, if speech recognition can be used for video note and voice note messages by all users
chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool can_set_custom_emoji_sticker_set:Bool can_recognize_speech:Bool = ChatBoostLevelFeatures; //@can_disable_sponsored_messages True, if sponsored messages can be disabled in the chat
chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool can_set_custom_emoji_sticker_set:Bool can_recognize_speech:Bool can_disable_sponsored_messages:Bool = ChatBoostLevelFeatures;
//@description Contains a list of features available on the first chat boost levels //@description Contains a list of features available on the first chat boost levels
//@features The list of features //@features The list of features
@ -3933,7 +3934,8 @@ chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reacti
//@min_custom_background_boost_level The minimum boost level required to set custom chat background //@min_custom_background_boost_level The minimum boost level required to set custom chat background
//@min_custom_emoji_sticker_set_boost_level The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only //@min_custom_emoji_sticker_set_boost_level The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only
//@min_speech_recognition_boost_level The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only //@min_speech_recognition_boost_level The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only
chatBoostFeatures features:vector<chatBoostLevelFeatures> min_profile_background_custom_emoji_boost_level:int32 min_background_custom_emoji_boost_level:int32 min_emoji_status_boost_level:int32 min_chat_theme_background_boost_level:int32 min_custom_background_boost_level:int32 min_custom_emoji_sticker_set_boost_level:int32 min_speech_recognition_boost_level:int32 = ChatBoostFeatures; //@min_sponsored_message_disable_boost_level The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only
chatBoostFeatures features:vector<chatBoostLevelFeatures> min_profile_background_custom_emoji_boost_level:int32 min_background_custom_emoji_boost_level:int32 min_emoji_status_boost_level:int32 min_chat_theme_background_boost_level:int32 min_custom_background_boost_level:int32 min_custom_emoji_sticker_set_boost_level:int32 min_speech_recognition_boost_level:int32 min_sponsored_message_disable_boost_level:int32 = ChatBoostFeatures;
//@class ChatBoostSource @description Describes source of a chat boost //@class ChatBoostSource @description Describes source of a chat boost

View File

@ -361,12 +361,13 @@ td_api::object_ptr<td_api::chatBoostLevelFeatures> BoostManager::get_chat_boost_
auto can_set_custom_background = have_enough_boost_level("custom_wallpaper"); auto can_set_custom_background = have_enough_boost_level("custom_wallpaper");
auto can_set_custom_emoji_sticker_set = have_enough_boost_level("emoji_stickers"); auto can_set_custom_emoji_sticker_set = have_enough_boost_level("emoji_stickers");
auto can_recognize_speech = have_enough_boost_level("transcribe"); auto can_recognize_speech = have_enough_boost_level("transcribe");
auto can_restrict_sponsored_messages = have_enough_boost_level("restrict_sponsored");
return td_api::make_object<td_api::chatBoostLevelFeatures>( return td_api::make_object<td_api::chatBoostLevelFeatures>(
level, actual_level, for_megagroup ? 0 : actual_level, theme_counts.title_color_count_, level, actual_level, for_megagroup ? 0 : actual_level, theme_counts.title_color_count_,
theme_counts.profile_accent_color_count_, can_set_profile_background_custom_emoji, theme_counts.profile_accent_color_count_, can_set_profile_background_custom_emoji,
theme_counts.accent_color_count_, can_set_background_custom_emoji, can_set_emoji_status, theme_counts.accent_color_count_, can_set_background_custom_emoji, can_set_emoji_status,
theme_counts.chat_theme_count_, can_set_custom_background, can_set_custom_emoji_sticker_set, theme_counts.chat_theme_count_, can_set_custom_background, can_set_custom_emoji_sticker_set, can_recognize_speech,
can_recognize_speech); can_restrict_sponsored_messages);
} }
td_api::object_ptr<td_api::chatBoostFeatures> BoostManager::get_chat_boost_features_object(bool for_megagroup) const { td_api::object_ptr<td_api::chatBoostFeatures> BoostManager::get_chat_boost_features_object(bool for_megagroup) const {
@ -381,7 +382,8 @@ td_api::object_ptr<td_api::chatBoostFeatures> BoostManager::get_chat_boost_featu
return td_api::make_object<td_api::chatBoostFeatures>( return td_api::make_object<td_api::chatBoostFeatures>(
std::move(features), get_min_boost_level("profile_bg_icon"), get_min_boost_level("bg_icon"), std::move(features), get_min_boost_level("profile_bg_icon"), get_min_boost_level("bg_icon"),
get_min_boost_level("emoji_status"), get_min_boost_level("wallpaper"), get_min_boost_level("custom_wallpaper"), get_min_boost_level("emoji_status"), get_min_boost_level("wallpaper"), get_min_boost_level("custom_wallpaper"),
get_min_boost_level("emoji_stickers"), get_min_boost_level("transcribe")); get_min_boost_level("emoji_stickers"), get_min_boost_level("transcribe"),
get_min_boost_level("restrict_sponsored"));
} }
void BoostManager::get_boost_slots(Promise<td_api::object_ptr<td_api::chatBoostSlots>> &&promise) { void BoostManager::get_boost_slots(Promise<td_api::object_ptr<td_api::chatBoostSlots>> &&promise) {