aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/Premium.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-10-17 15:48:11 +0300
committerlevlam <levlam@telegram.org>2025-10-17 15:48:11 +0300
commit9cbccaf3cf0ed456a723463c305cc58dd7653fa1 (patch)
treebbde3fd000a32afc383eec724357bf7eee9733c8 /td/telegram/Premium.cpp
parentdd8e0e41ecb6db8ed157d007d3d63034c52bd212 (diff)
Update layer to 217.
Diffstat (limited to 'td/telegram/Premium.cpp')
-rw-r--r--td/telegram/Premium.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/td/telegram/Premium.cpp b/td/telegram/Premium.cpp
index cc86eb7e3..f19ff7596 100644
--- a/td/telegram/Premium.cpp
+++ b/td/telegram/Premium.cpp
@@ -520,7 +520,7 @@ class CheckGiftCodeQuery final : public Td::ResultHandler {
td_->user_manager_->on_get_users(std::move(result->users_), "CheckGiftCodeQuery");
td_->chat_manager_->on_get_chats(std::move(result->chats_), "CheckGiftCodeQuery");
- if (result->date_ <= 0 || result->months_ <= 0 || result->used_date_ < 0) {
+ if (result->date_ <= 0 || result->days_ <= 0 || result->used_date_ < 0) {
LOG(ERROR) << "Receive " << to_string(result);
return on_error(Status::Error(500, "Receive invalid response"));
}
@@ -554,7 +554,7 @@ class CheckGiftCodeQuery final : public Td::ResultHandler {
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->months_,
+ result->date_, result->via_giveaway_, message_id.get(), max(1, result->days_ / 30),
td_->user_manager_->get_user_id_object(user_id, "premiumGiftCodeInfo"), result->used_date_));
}