mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-22 18:08:31 +00:00
Update TDLib to 1.8.49.
This commit is contained in:
parent
e0d481aa9d
commit
ac02daabc1
2
td
2
td
@ -1 +1 @@
|
||||
Subproject commit b8b08b02dbbc0c05e7129e2f306c636c5b8ec04f
|
||||
Subproject commit e6d0516e0def13ed6a75ec10b9ac8d4383379245
|
@ -750,16 +750,16 @@ class Client::JsonGift final : public td::Jsonable {
|
||||
|
||||
class Client::JsonGifts final : public td::Jsonable {
|
||||
public:
|
||||
JsonGifts(const td_api::gifts *gifts, const Client *client) : gifts_(gifts), client_(client) {
|
||||
JsonGifts(const td::vector<td_api::object_ptr<td_api::gift>> &gifts, const Client *client)
|
||||
: gifts_(gifts), client_(client) {
|
||||
}
|
||||
void store(td::JsonValueScope *scope) const {
|
||||
auto object = scope->enter_object();
|
||||
object("gifts",
|
||||
td::json_array(gifts_->gifts_, [client = client_](auto &gift) { return JsonGift(gift.get(), client); }));
|
||||
object("gifts", td::json_array(gifts_, [client = client_](auto &gift) { return JsonGift(gift.get(), client); }));
|
||||
}
|
||||
|
||||
private:
|
||||
const td_api::gifts *gifts_;
|
||||
const td::vector<td_api::object_ptr<td_api::gift>> &gifts_;
|
||||
const Client *client_;
|
||||
};
|
||||
|
||||
@ -6594,11 +6594,11 @@ class Client::TdOnGetGiftsCallback final : public TdQueryCallback {
|
||||
return fail_query_with_error(std::move(query_), move_object_as<td_api::error>(result));
|
||||
}
|
||||
|
||||
CHECK(result->get_id() == td_api::gifts::ID);
|
||||
auto gifts = move_object_as<td_api::gifts>(result);
|
||||
td::remove_if(gifts->gifts_,
|
||||
[](const auto &gift) { return gift->total_count_ > 0 && gift->remaining_count_ == 0; });
|
||||
answer_query(JsonGifts(gifts.get(), client_), std::move(query_));
|
||||
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_));
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user