2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Update API scheme on layer 166.

This commit is contained in:
John Preston
2023-10-13 16:17:02 +04:00
parent ef0539c9fc
commit f90a010b84
18 changed files with 106 additions and 39 deletions

View File

@@ -286,8 +286,11 @@ void Premium::resolveGiveawayInfo(
info.adminChannelId = data.vadmin_disallowed_chat_id()
? ChannelId(*data.vadmin_disallowed_chat_id())
: ChannelId();
info.disallowedCountry = qs(
data.vdisallowed_country().value_or_empty());
info.tooEarlyDate
= data.vjoined_too_early_date().value_or_empty();
info.startDate = data.vstart_date().v;
}, [&](const MTPDpayments_giveawayInfoResults &data) {
info.state = data.is_refunded()
? GiveawayState::Refunded
@@ -295,6 +298,7 @@ void Premium::resolveGiveawayInfo(
info.giftCode = qs(data.vgift_code_slug().value_or_empty());
info.activatedCount = data.vactivated_count().v;
info.finishDate = data.vfinish_date().v;
info.startDate = data.vstart_date().v;
});
_giveawayInfoDone(std::move(info));
}).fail([=] {

View File

@@ -46,10 +46,12 @@ enum class GiveawayState {
struct GiveawayInfo {
QString giftCode;
QString disallowedCountry;
ChannelId adminChannelId = 0;
GiveawayState state = GiveawayState::Invalid;
TimeId tooEarlyDate = 0;
TimeId finishDate = 0;
TimeId startDate = 0;
int winnersCount = 0;
int activatedCount = 0;
bool participating = false;