From 9efd9b0d689b9c4d89776fb27a6ee1a838df3816 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 31 Aug 2024 07:53:45 +0300 Subject: [PATCH] Slightly improved timestamp parsing in Api::Boosts. --- Telegram/SourceFiles/api/api_statistics.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/api/api_statistics.cpp b/Telegram/SourceFiles/api/api_statistics.cpp index 5586245f4..23bf96e70 100644 --- a/Telegram/SourceFiles/api/api_statistics.cpp +++ b/Telegram/SourceFiles/api/api_statistics.cpp @@ -576,8 +576,7 @@ rpl::producer Boosts::request() { .months = data.vmonths().v, .id = data.vid().v, .quantity = data.vquantity().v, - .date = QDateTime::fromSecsSinceEpoch( - data.vdate().v), + .date = base::unixtime::parse(data.vdate().v), }; }, [&](const MTPDprepaidStarsGiveaway &data) { return Data::BoostPrepaidGiveaway(AssertIsDebug()); @@ -644,8 +643,8 @@ void Boosts::requestBoosts( .giveawayMessage = data.vgiveaway_msg_id() ? FullMsgId{ _peer->id, data.vgiveaway_msg_id()->v } : FullMsgId(), - .date = QDateTime::fromSecsSinceEpoch(data.vdate().v), - .expiresAt = QDateTime::fromSecsSinceEpoch(data.vexpires().v), + .date = base::unixtime::parse(data.vdate().v), + .expiresAt = base::unixtime::parse(data.vexpires().v), .expiresAfterMonths = ((data.vexpires().v - data.vdate().v) / kMonthsDivider), .giftCodeLink = std::move(giftCodeLink),