Add td_api::suggestedActionGiftPremiumForChristmas.
This commit is contained in:
parent
24611b1fd5
commit
022c227515
@ -5927,6 +5927,9 @@ suggestedActionRestorePremium = SuggestedAction;
|
||||
//@description Suggests the user to subscribe to the Premium subscription with annual payments
|
||||
suggestedActionSubscribeToAnnualPremium = SuggestedAction;
|
||||
|
||||
//@description Suggests the user to gift Telegram Premium to friends for Christmas
|
||||
suggestedActionGiftPremiumForChristmas = SuggestedAction;
|
||||
|
||||
|
||||
//@description Contains a counter @count Count
|
||||
count count:int32 = Count;
|
||||
|
@ -44,6 +44,8 @@ SuggestedAction::SuggestedAction(Slice action_str) {
|
||||
init(Type::SubscribeToAnnualPremium);
|
||||
} else if (action_str == Slice("PREMIUM_RESTORE")) {
|
||||
init(Type::RestorePremium);
|
||||
} else if (action_str == Slice("PREMIUM_CHRISTMAS")) {
|
||||
init(Type::GiftPremiumForChristmas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +98,9 @@ SuggestedAction::SuggestedAction(const td_api::object_ptr<td_api::SuggestedActio
|
||||
case td_api::suggestedActionRestorePremium::ID:
|
||||
init(Type::RestorePremium);
|
||||
break;
|
||||
case td_api::suggestedActionGiftPremiumForChristmas::ID:
|
||||
init(Type::GiftPremiumForChristmas);
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
@ -121,6 +126,8 @@ string SuggestedAction::get_suggested_action_str() const {
|
||||
return "PREMIUM_ANNUAL";
|
||||
case Type::RestorePremium:
|
||||
return "PREMIUM_RESTORE";
|
||||
case Type::GiftPremiumForChristmas:
|
||||
return "PREMIUM_CHRISTMAS";
|
||||
default:
|
||||
return string();
|
||||
}
|
||||
@ -148,6 +155,8 @@ td_api::object_ptr<td_api::SuggestedAction> SuggestedAction::get_suggested_actio
|
||||
return td_api::make_object<td_api::suggestedActionSubscribeToAnnualPremium>();
|
||||
case Type::RestorePremium:
|
||||
return td_api::make_object<td_api::suggestedActionRestorePremium>();
|
||||
case Type::GiftPremiumForChristmas:
|
||||
return td_api::make_object<td_api::suggestedActionGiftPremiumForChristmas>();
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return nullptr;
|
||||
@ -209,6 +218,7 @@ void dismiss_suggested_action(SuggestedAction action, Promise<Unit> &&promise) {
|
||||
case SuggestedAction::Type::UpgradePremium:
|
||||
case SuggestedAction::Type::SubscribeToAnnualPremium:
|
||||
case SuggestedAction::Type::RestorePremium:
|
||||
case SuggestedAction::Type::GiftPremiumForChristmas:
|
||||
return send_closure_later(G()->config_manager(), &ConfigManager::dismiss_suggested_action, std::move(action),
|
||||
std::move(promise));
|
||||
case SuggestedAction::Type::ConvertToGigagroup:
|
||||
|
@ -26,7 +26,8 @@ struct SuggestedAction {
|
||||
SetPassword,
|
||||
UpgradePremium,
|
||||
SubscribeToAnnualPremium,
|
||||
RestorePremium
|
||||
RestorePremium,
|
||||
GiftPremiumForChristmas
|
||||
};
|
||||
Type type_ = Type::Empty;
|
||||
DialogId dialog_id_;
|
||||
|
Loading…
Reference in New Issue
Block a user