aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-08-19 15:59:15 +0300
committerlevlam <levlam@telegram.org>2025-08-19 15:59:15 +0300
commitca2df76f135a59d92155e3475e19a114cbd82d7a (patch)
treefa298c00500040bfc1e5c99aefff74d96edcb8a5
parent3b6a0b769c4a7fbe064087a4ad9fe6b1dbda498f (diff)
Update TDLib to 1.8.53.
m---------td0
-rw-r--r--telegram-bot-api/Client.cpp37
2 files changed, 26 insertions, 11 deletions
diff --git a/td b/td
-Subproject a9863453385e09f09a6f746f78ad39ca6530b6a
+Subproject 1a7acf081e34836984942800bfa8eda72a61579
diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp
index 9979f6e..d7e63bf 100644
--- a/telegram-bot-api/Client.cpp
+++ b/telegram-bot-api/Client.cpp
@@ -1285,9 +1285,9 @@ class Client::JsonGift final : public td::Jsonable {
if (gift_->upgrade_star_count_ > 0) {
object("upgrade_star_count", gift_->upgrade_star_count_);
}
- if (gift_->total_count_ > 0) {
- object("remaining_count", gift_->remaining_count_);
- object("total_count", gift_->total_count_);
+ if (gift_->overall_limits_ != nullptr && gift_->overall_limits_->total_count_ > 0) {
+ object("remaining_count", gift_->overall_limits_->remaining_count_);
+ object("total_count", gift_->overall_limits_->total_count_);
}
if (gift_->publisher_chat_id_ != 0) {
object("publisher_chat", JsonChat(gift_->publisher_chat_id_, client_));
@@ -2722,7 +2722,23 @@ class Client::JsonUniqueGiftMessage final : public td::Jsonable {
case td_api::upgradedGiftOriginResale::ID: {
auto origin = static_cast<const td_api::upgradedGiftOriginResale *>(gift_->origin_.get());
object("origin", "resale");
- object("last_resale_star_count", origin->star_count_);
+ switch (origin->price_->get_id()) {
+ case td_api::giftResalePriceStar::ID: {
+ auto price = static_cast<const td_api::giftResalePriceStar *>(origin->price_.get());
+ object("last_resale_star_count", price->star_count_);
+ object("last_resale_currency", "XTR");
+ object("last_resale_amount", price->star_count_);
+ break;
+ }
+ case td_api::giftResalePriceTon::ID: {
+ auto price = static_cast<const td_api::giftResalePriceTon *>(origin->price_.get());
+ object("last_resale_currency", "TON");
+ object("last_resale_amount", price->toncoin_cent_count_ * 10000000);
+ break;
+ }
+ default:
+ UNREACHABLE();
+ }
break;
}
default:
@@ -7051,7 +7067,6 @@ class Client::TdOnGetGiftsCallback final : public TdQueryCallback {
CHECK(result->get_id() == td_api::availableGifts::ID);
auto available_gifts = move_object_as<td_api::availableGifts>(result);
auto gifts = td::transform(std::move(available_gifts->gifts_), [](auto &&gift) { return std::move(gift->gift_); });
- td::remove_if(gifts, [](const auto &gift) { return gift->total_count_ > 0 && gift->remaining_count_ == 0; });
answer_query(JsonGifts(gifts, client_), std::move(query_));
}
@@ -12818,11 +12833,11 @@ td::Status Client::process_post_story_query(PromisedQueryPtr &query) {
auto active_period = get_integer_arg(query.get(), "active_period", 0, 0, 1000000000);
auto is_posted_to_chat_page = to_bool(query->arg("post_to_chat_page"));
auto protect_content = to_bool(query->arg("protect_content"));
- send_request(
- make_object<td_api::postStory>(business_connection->user_chat_id_, std::move(content), std::move(areas),
- std::move(caption), make_object<td_api::storyPrivacySettingsEveryone>(),
- active_period, nullptr, is_posted_to_chat_page, protect_content),
- td::make_unique<TdOnPostStoryCallback>(this, std::move(query)));
+ send_request(make_object<td_api::postStory>(
+ business_connection->user_chat_id_, std::move(content), std::move(areas), std::move(caption),
+ make_object<td_api::storyPrivacySettingsEveryone>(), td::vector<int32>(), active_period,
+ nullptr, is_posted_to_chat_page, protect_content),
+ td::make_unique<TdOnPostStoryCallback>(this, std::move(query)));
});
return td::Status::OK();
}
@@ -13414,7 +13429,7 @@ td::Status Client::process_get_business_account_gifts_query(PromisedQueryPtr &qu
auto limit = get_integer_arg(query.get(), "limit", 100, 1, 100);
send_request(make_object<td_api::getReceivedGifts>(
business_connection->id_, make_object<td_api::messageSenderUser>(my_id_),
- exclude_unsaved, exclude_saved, exclude_unlimited, exclude_limited,
+ 0, exclude_unsaved, exclude_saved, exclude_unlimited, exclude_limited,
exclude_upgraded, sort_by_price, offset.str(), limit),
td::make_unique<TdOnGetReceivedGiftsCallback>(this, std::move(query)));
});