diff --git a/Telegram/SourceFiles/api/api_premium.cpp b/Telegram/SourceFiles/api/api_premium.cpp index daa9d83cb4..313ec1bd1a 100644 --- a/Telegram/SourceFiles/api/api_premium.cpp +++ b/Telegram/SourceFiles/api/api_premium.cpp @@ -529,7 +529,7 @@ rpl::producer PremiumGiftCodeOptions::applyPrepaid( _api.request(MTPpayments_LaunchPrepaidGiveaway( _peer->input, MTP_long(prepaidId), - invoice.creditsAmount + invoice.giveawayCredits ? Payments::InvoiceCreditsGiveawayToTL(invoice) : Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice) )).done([=](const MTPUpdates &result) { diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp index 2a4abeb288..a5a73614e6 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp @@ -1402,7 +1402,7 @@ void CreateGiveawayBox( auto invoice = [&] { if (isPrepaidCredits) { return Payments::InvoicePremiumGiftCode{ - .creditsAmount = prepaid->credits, + .giveawayCredits = prepaid->credits, .randomId = prepaid->id, .users = prepaid->quantity, }; @@ -1412,7 +1412,7 @@ void CreateGiveawayBox( return Payments::InvoicePremiumGiftCode{ .currency = option.currency, .storeProduct = option.storeProduct, - .creditsAmount = option.credits, + .giveawayCredits = option.credits, .randomId = UniqueIdFromCreditsOption(option, peer), .amount = option.amount, .users = state->sliderValue.current(), diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index a08aa4f825..a17b2dcfd4 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -178,7 +178,7 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL( MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL( const InvoicePremiumGiftCode &invoice) { - Expects(invoice.creditsAmount.has_value()); + Expects(invoice.giveawayCredits.has_value()); const auto &giveaway = v::get( invoice.purpose); using Flag = MTPDinputStorePaymentStarsGiveaway::Flag; @@ -199,7 +199,7 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL( | (giveaway.additionalPrize.isEmpty() ? Flag() : Flag::f_prize_description)), - MTP_long(*invoice.creditsAmount), + MTP_long(*invoice.giveawayCredits), giveaway.boostPeer->input, MTP_vector_from_range(ranges::views::all( giveaway.additionalChannels @@ -222,7 +222,7 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL( bool IsPremiumForStarsInvoice(const InvoiceId &id) { const auto giftCode = std::get_if(&id.value); return giftCode - && !giftCode->creditsAmount + && !giftCode->giveawayCredits && (giftCode->currency == ::Ui::kCreditsCurrency); } @@ -402,7 +402,7 @@ MTPInputInvoice Form::inputInvoice() const { Api::ConvertOption::SkipLocal))); } const auto &giftCode = v::get(_id.value); - if (giftCode.creditsAmount) { + if (giftCode.giveawayCredits) { return MTP_inputInvoiceStars(InvoiceCreditsGiveawayToTL(giftCode)); } using Flag = MTPDpremiumGiftCodeOption::Flag; diff --git a/Telegram/SourceFiles/payments/payments_form.h b/Telegram/SourceFiles/payments/payments_form.h index 8fa322c723..2e199e3598 100644 --- a/Telegram/SourceFiles/payments/payments_form.h +++ b/Telegram/SourceFiles/payments/payments_form.h @@ -153,7 +153,7 @@ struct InvoicePremiumGiftCode { QString currency; QString storeProduct; - std::optional creditsAmount; + std::optional giveawayCredits; uint64 randomId = 0; uint64 amount = 0; int storeQuantity = 0;