2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Update API scheme to layer 168. Giveaways.

This commit is contained in:
John Preston
2023-12-08 10:37:37 +04:00
parent f5b59c9456
commit e135f8954f
10 changed files with 258 additions and 58 deletions

View File

@@ -145,7 +145,13 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL(
: Flag::f_additional_peers)
| (giveaway.countries.empty()
? Flag()
: Flag::f_countries_iso2)),
: Flag::f_countries_iso2)
| (giveaway.showWinners
? Flag::f_winners_are_visible
: Flag())
| (giveaway.additionalPrize.isEmpty()
? Flag()
: Flag::f_prize_description)),
giveaway.boostPeer->input,
MTP_vector_from_range(ranges::views::all(
giveaway.additionalChannels
@@ -157,6 +163,7 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL(
) | ranges::views::transform([](QString value) {
return MTP_string(value);
})),
MTP_string(giveaway.additionalPrize),
MTP_long(invoice.randomId),
MTP_int(giveaway.untilDate),
MTP_string(invoice.currency),

View File

@@ -190,8 +190,10 @@ struct InvoicePremiumGiftCodeGiveaway {
not_null<ChannelData*> boostPeer;
std::vector<not_null<ChannelData*>> additionalChannels;
std::vector<QString> countries;
QString additionalPrize;
TimeId untilDate = 0;
bool onlyNewSubscribers = false;
bool showWinners = false;
};
struct InvoicePremiumGiftCodeUsers {