Add more information to chatBoostFeatures.

This commit is contained in:
levlam 2024-01-02 17:32:30 +03:00
parent 8e2ef00696
commit a9d1269567
2 changed files with 14 additions and 3 deletions

View File

@ -3658,8 +3658,14 @@ 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
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 = ChatBoostLevelFeatures;
//@description Contains a list of features available on the first chat boost levels @features The list of features
chatBoostFeatures features:vector<chatBoostLevelFeatures> = ChatBoostFeatures;
//@description Contains a list of features available on the first chat boost levels
//@features The list of features
//@min_profile_background_custom_emoji_boost_level The minimum boost level required to set custom emoji for profile background
//@min_background_custom_emoji_boost_level The minimum boost level required to set custom emoji for reply header and link preview background
//@min_emoji_status_boost_level The minimum boost level required to set emoji status
//@min_chat_theme_background_boost_level The minimum boost level required to set a chat theme background as chat background
//@min_custom_background_boost_level The minimum boost level required to set custom chat background
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 = ChatBoostFeatures;
//@class ChatBoostSource @description Describes source of a chat boost

View File

@ -367,7 +367,12 @@ td_api::object_ptr<td_api::chatBoostFeatures> BoostManager::get_chat_boost_featu
for (int32 level = 1; level <= 10; level++) {
features.push_back(get_chat_boost_level_features_object(level));
}
return td_api::make_object<td_api::chatBoostFeatures>(std::move(features));
auto get_min_boost_level = [&](Slice name) {
return narrow_cast<int32>(td_->option_manager_->get_option_integer(PSLICE() << "channel_" << name << "_level_min"));
};
return td_api::make_object<td_api::chatBoostFeatures>(
std::move(features), get_min_boost_level("profile_bg_icon"), get_min_boost_level("profile_bg_icon"),
get_min_boost_level("emoji_status"), get_min_boost_level("wallpaper"), get_min_boost_level("custom_wallpaper"));
}
void BoostManager::get_boost_slots(Promise<td_api::object_ptr<td_api::chatBoostSlots>> &&promise) {