diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index eba1d96f3..691cea75f 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -10742,8 +10742,8 @@ launchPrepaidPremiumGiveaway giveaway_id:int64 parameters:premiumGiveawayParamet //@message_id Identifier of the giveaway or a giveaway winners message in the chat getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo; -//@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose -canPurchasePremium purpose:StorePaymentPurpose = Ok; +//@description Checks whether an in-store purchase is possible. Must be called before any in-store purchase @purpose Transaction purpose +canPurchaseFromStore purpose:StorePaymentPurpose = Ok; //@description Informs server about a purchase through App Store. For official applications only @receipt App Store receipt @purpose Transaction purpose assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok; diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 944ee8b88..9b98f71a4 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -9388,7 +9388,7 @@ void Td::on_request(uint64 id, const td_api::getPremiumGiveawayInfo &request) { get_premium_giveaway_info(this, {DialogId(request.chat_id_), MessageId(request.message_id_)}, std::move(promise)); } -void Td::on_request(uint64 id, td_api::canPurchasePremium &request) { +void Td::on_request(uint64 id, td_api::canPurchaseFromStore &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); can_purchase_premium(this, std::move(request.purpose_), std::move(promise)); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 1e6a92b3b..c60706390 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -1833,7 +1833,7 @@ class Td final : public Actor { void on_request(uint64 id, const td_api::getPremiumGiveawayInfo &request); - void on_request(uint64 id, td_api::canPurchasePremium &request); + void on_request(uint64 id, td_api::canPurchaseFromStore &request); void on_request(uint64 id, td_api::assignAppStoreTransaction &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index c3c7626c5..cfe380c6d 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3380,36 +3380,36 @@ class CliClient final : public Actor { MessageId message_id; get_args(args, chat_id, message_id); send_request(td_api::make_object(chat_id, message_id)); - } else if (op == "cppr" || op == "cpprb") { + } else if (op == "cpfs" || op == "cpfsb") { UserId user_id; string currency; int64 amount; ChatId boosted_chat_id; get_args(args, user_id, currency, amount, boosted_chat_id); if (currency.empty()) { - send_request(td_api::make_object( + send_request(td_api::make_object( td_api::make_object(false, false))); - } else if (op == "cppr") { - send_request(td_api::make_object( + } else if (op == "cpfs") { + send_request(td_api::make_object( td_api::make_object(user_id, currency, amount))); } else { - send_request(td_api::make_object( + send_request(td_api::make_object( td_api::make_object(boosted_chat_id, currency, amount, vector{user_id}))); } - } else if (op == "cpprg") { + } else if (op == "cpfsg") { PremiumGiveawayParameters parameters; string currency; int64 amount; get_args(args, parameters, currency, amount); - send_request(td_api::make_object( + send_request(td_api::make_object( td_api::make_object(parameters, currency, amount))); - } else if (op == "cpprs") { + } else if (op == "cpfss") { string currency; int64 amount; int64 star_count; get_args(args, currency, amount, star_count); - send_request(td_api::make_object( + send_request(td_api::make_object( td_api::make_object(currency, amount, star_count))); } else if (op == "gbf") { send_request(td_api::make_object(nullptr));