aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/Premium.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-11-25 22:09:01 +0300
committerlevlam <levlam@telegram.org>2025-11-25 22:09:01 +0300
commitd3d2531e95a1ab7cc4ed865ea9e143bf637a14e8 (patch)
tree25d147a3e6fe979c5a65596936317da8e3a9d3d6 /td/telegram/Premium.cpp
parent144292d2273bca7d987012a9dec18c8bc92a1586 (diff)
Return back duration of Telegram Premium subscription in months.
Diffstat (limited to 'td/telegram/Premium.cpp')
-rw-r--r--td/telegram/Premium.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/td/telegram/Premium.cpp b/td/telegram/Premium.cpp
index c8b094e82..9c0aead7a 100644
--- a/td/telegram/Premium.cpp
+++ b/td/telegram/Premium.cpp
@@ -551,10 +551,12 @@ class CheckGiftCodeQuery final : public Td::ResultHandler {
LOG(ERROR) << "Receive " << to_string(result);
message_id = MessageId();
}
+ auto month_count = get_premium_duration_month_count(result->days_);
promise_.set_value(td_api::make_object<td_api::premiumGiftCodeInfo>(
creator_dialog_id == DialogId() ? nullptr
: get_message_sender_object(td_, creator_dialog_id, "premiumGiftCodeInfo"),
- result->date_, result->via_giveaway_, message_id.get(), result->days_,
+ result->date_, result->via_giveaway_, message_id.get(),
+ get_premium_duration_day_count(month_count) == result->days_ ? month_count : 0, result->days_,
td_->user_manager_->get_user_id_object(user_id, "premiumGiftCodeInfo"), result->used_date_));
}