From 4ef53487dc2a4931a044128747228f9c2aeb3ce5 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 13 Oct 2023 11:57:43 +0300 Subject: [PATCH] Add creation_date to information about giveaway. --- td/generate/scheme/td_api.tl | 6 ++++-- td/telegram/Premium.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 3e66e8f6b..9d2dfcb7f 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -728,17 +728,19 @@ premiumGiveawayParticipantStatusDisallowedCountry user_country_code:string = Pre //@class PremiumGiveawayInfo @description Contains information about Telegram Premium giveaway //@description Describes an ongoing giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created //@status Status of the current user in the giveaway //@is_ended True, if the giveaway has ended and results are being prepared -premiumGiveawayInfoOngoing status:PremiumGiveawayParticipantStatus is_ended:Bool = PremiumGiveawayInfo; +premiumGiveawayInfoOngoing creation_date:int32 status:PremiumGiveawayParticipantStatus is_ended:Bool = PremiumGiveawayInfo; //@description Describes a completed giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created //@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway //@was_refunded True, if the giveaway was canceled and was fully refunded //@winner_count Number of winners in the giveaway //@activation_count Number of winners, which activated their gift codes //@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway -premiumGiveawayInfoCompleted actual_winners_selection_date:int32 was_refunded:Bool winner_count:int32 activation_count:int32 gift_code:string = PremiumGiveawayInfo; +premiumGiveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool winner_count:int32 activation_count:int32 gift_code:string = PremiumGiveawayInfo; //@description Describes a custom emoji to be shown instead of the Telegram Premium badge diff --git a/td/telegram/Premium.cpp b/td/telegram/Premium.cpp index df003f538..6f82bd8ac 100644 --- a/td/telegram/Premium.cpp +++ b/td/telegram/Premium.cpp @@ -461,8 +461,8 @@ class GetGiveawayInfoQuery final : public Td::ResultHandler { } return td_api::make_object(); }(); - promise_.set_value( - td_api::make_object(std::move(status), info->preparing_results_)); + promise_.set_value(td_api::make_object( + max(0, info->start_date_), std::move(status), info->preparing_results_)); break; } case telegram_api::payments_giveawayInfoResults::ID: { @@ -482,7 +482,8 @@ class GetGiveawayInfoQuery final : public Td::ResultHandler { } } promise_.set_value(td_api::make_object( - max(0, info->finish_date_), info->refunded_, winner_count, activated_count, info->gift_code_slug_)); + max(0, info->start_date_), max(0, info->finish_date_), info->refunded_, winner_count, activated_count, + info->gift_code_slug_)); break; } default: