Add premiumLimitTypeBioLength.

This commit is contained in:
levlam 2022-05-30 02:20:12 +03:00
parent 677c5795a3
commit 549b86371d
3 changed files with 12 additions and 2 deletions

View File

@ -2908,6 +2908,9 @@ premiumLimitTypePinnedArchivedChatCount = PremiumLimitType;
//@description The maximum length of sent media caption
premiumLimitTypeCaptionLength = PremiumLimitType;
//@description The maximum length of the user's bio
premiumLimitTypeBioLength = PremiumLimitType;
//@class PremiumFeature @description Describes a feature available to Premium users

View File

@ -156,7 +156,8 @@ void OptionManager::clear_options() {
bool OptionManager::is_internal_option(Slice name) {
switch (name[0]) {
case 'a':
return name == "animated_emoji_zoom" || name == "animation_search_emojis" ||
return name == "about_length_limit_default" || name == "about_length_limit_premium" ||
name == "animated_emoji_zoom" || name == "animation_search_emojis" ||
name == "animation_search_provider" || name == "auth";
case 'b':
return name == "base_language_pack_version";

View File

@ -24,7 +24,8 @@ const vector<Slice> &get_premium_limit_keys() {
"dialogs_pinned",
"dialogs_folder_pinned",
"channels_public",
"caption_length"};
"caption_length",
"about_length"};
return limit_keys;
}
@ -49,6 +50,8 @@ static Slice get_limit_type_key(const td_api::PremiumLimitType *limit_type) {
return Slice("channels_public");
case td_api::premiumLimitTypeCaptionLength::ID:
return Slice("caption_length");
case td_api::premiumLimitTypeBioLength::ID:
return Slice("about_length");
default:
UNREACHABLE();
return Slice();
@ -159,6 +162,9 @@ static td_api::object_ptr<td_api::premiumLimit> get_premium_limit_object(Slice k
if (key == "caption_length") {
return td_api::make_object<td_api::premiumLimitTypeCaptionLength>();
}
if (key == "about_length") {
return td_api::make_object<td_api::premiumLimitTypeBioLength>();
}
UNREACHABLE();
return nullptr;
}();