Add td_api::premiumFeatureRealTimeChatTranslation.

This commit is contained in:
levlam 2023-01-25 21:26:09 +03:00
parent 17f16ce839
commit a4f61ce47d
2 changed files with 10 additions and 1 deletions

View File

@ -3821,6 +3821,9 @@ premiumFeatureForumTopicIcon = PremiumFeature;
//@description Allowed to set a premium appllication icons //@description Allowed to set a premium appllication icons
premiumFeatureAppIcons = PremiumFeature; premiumFeatureAppIcons = PremiumFeature;
//@description Allowed to translate chat messages real-time
premiumFeatureRealTimeChatTranslation = PremiumFeature;
//@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users //@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users
premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit; premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit;

View File

@ -75,6 +75,9 @@ static td_api::object_ptr<td_api::PremiumFeature> get_premium_feature_object(Sli
if (premium_feature == "app_icons") { if (premium_feature == "app_icons") {
return td_api::make_object<td_api::premiumFeatureAppIcons>(); return td_api::make_object<td_api::premiumFeatureAppIcons>();
} }
if (premium_feature == "translations") {
return td_api::make_object<td_api::premiumFeatureRealTimeChatTranslation>();
}
return nullptr; return nullptr;
} }
@ -372,6 +375,8 @@ static string get_premium_source(const td_api::PremiumFeature *feature) {
return "forum_topic_icon"; return "forum_topic_icon";
case td_api::premiumFeatureAppIcons::ID: case td_api::premiumFeatureAppIcons::ID:
return "app_icons"; return "app_icons";
case td_api::premiumFeatureRealTimeChatTranslation::ID:
return "translations";
default: default:
UNREACHABLE(); UNREACHABLE();
} }
@ -464,7 +469,8 @@ void get_premium_features(Td *td, const td_api::object_ptr<td_api::PremiumSource
G()->get_option_string( G()->get_option_string(
"premium_features", "premium_features",
"double_limits,more_upload,faster_download,voice_to_text,no_ads,infinite_reactions,premium_stickers," "double_limits,more_upload,faster_download,voice_to_text,no_ads,infinite_reactions,premium_stickers,"
"animated_emoji,advanced_chat_management,profile_badge,emoji_status,animated_userpics,app_icons"), "animated_emoji,advanced_chat_management,profile_badge,emoji_status,animated_userpics,app_icons,"
"translations"),
','); ',');
vector<td_api::object_ptr<td_api::PremiumFeature>> features; vector<td_api::object_ptr<td_api::PremiumFeature>> features;
for (const auto &premium_feature : premium_features) { for (const auto &premium_feature : premium_features) {