From 6dae0a5654b46f7c2f64d3e67eec014c0711ed28 Mon Sep 17 00:00:00 2001 From: Fela Date: Sun, 6 Oct 2024 12:33:59 +0400 Subject: [PATCH] Return soldout gifts --- td/telegram/StarGift.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/td/telegram/StarGift.cpp b/td/telegram/StarGift.cpp index 67c79dde41c4..67c09f1f06c8 100644 --- a/td/telegram/StarGift.cpp +++ b/td/telegram/StarGift.cpp @@ -32,10 +32,10 @@ StarGift::StarGift(Td *td, telegram_api::object_ptr &&st star_gift->availability_total_ = 0; } if ((star_gift->availability_total_ != 0 || star_gift->availability_remains_ != 0) && - (star_gift->availability_remains_ <= 0 || star_gift->availability_remains_ > star_gift->availability_total_)) { + (star_gift->availability_remains_ < 0 || star_gift->availability_remains_ > star_gift->availability_total_)) { LOG(ERROR) << "Receive " << star_gift->availability_total_ << " remained available gifts out of " << star_gift->availability_total_; - if (star_gift->availability_remains_ <= 0) { + if (star_gift->availability_remains_ < 0) { return; } star_gift->availability_remains_ = star_gift->availability_total_;