From 2001518ec568b53af764c3bada22f329c4693062 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 9 May 2022 19:25:56 +0300 Subject: [PATCH] Update TDLib to 1.8.4. --- td | 2 +- telegram-bot-api/Client.cpp | 36 ++++++++++-------------------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/td b/td index ab3a828..b393215 160000 --- a/td +++ b/td @@ -1 +1 @@ -Subproject commit ab3a8282d4ee307d341071267ef1090b1a941478 +Subproject commit b393215d6671863b6baf2a589d343cff9474f6ba diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 5c0a153..957f6d3 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -1195,7 +1195,7 @@ class Client::JsonInvoice final : public Jsonable { void store(JsonValueScope *scope) const { auto object = scope->enter_object(); object("title", invoice_->title_); - object("description", invoice_->description_); + object("description", invoice_->description_->text_); object("start_parameter", invoice_->start_parameter_); object("currency", invoice_->currency_); object("total_amount", invoice_->total_amount_); @@ -1860,10 +1860,7 @@ void Client::JsonMessage::store(JsonValueScope *scope) const { } case td_api::messageChatChangePhoto::ID: { auto content = static_cast(message_->content.get()); - if (content->photo_ == nullptr) { - LOG(ERROR) << "Got empty messageChatChangePhoto"; - break; - } + CHECK(content->photo_ != nullptr); object("new_chat_photo", JsonChatPhoto(content->photo_.get(), client_)); break; } @@ -4603,7 +4600,9 @@ void Client::on_update(object_ptr result) { auto user_id = update->user_id_; auto full_info = update->user_full_info_.get(); set_user_photo(user_id, std::move(full_info->photo_)); - set_user_bio(user_id, std::move(full_info->bio_)); + if (full_info->bio_ != nullptr) { + set_user_bio(user_id, std::move(full_info->bio_->text_)); + } set_user_has_private_forwards(user_id, full_info->has_private_forwards_); break; } @@ -5478,8 +5477,9 @@ td::Result> Client::get_input_me return make_object( make_object(currency, std::move(prices), max_tip_amount, std::move(suggested_tip_amounts), - false, need_name, need_phone_number, need_email_address, need_shipping_address, - send_phone_number_to_provider, send_email_address_to_provider, is_flexible), + td::string(), false, need_name, need_phone_number, need_email_address, + need_shipping_address, send_phone_number_to_provider, + send_email_address_to_provider, is_flexible), title, description, photo_url, photo_size, photo_width, photo_height, payload, provider_token, provider_data, td::string()); } @@ -7111,7 +7111,7 @@ td::Status Client::process_send_invoice_query(PromisedQueryPtr &query) { do_send_message(make_object( make_object( currency.str(), std::move(prices), max_tip_amount, std::move(suggested_tip_amounts), false, - need_name, need_phone_number, need_email_address, need_shipping_address, + td::string(), need_name, need_phone_number, need_email_address, need_shipping_address, send_phone_number_to_provider, send_email_address_to_provider, is_flexible), title.str(), description.str(), photo_url.str(), photo_size, photo_width, photo_height, payload.str(), provider_token.str(), provider_data.str(), start_parameter.str()), @@ -9576,14 +9576,6 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptrcontent_->get_id()) { - case td_api::messagePhoto::ID: { - auto content = static_cast(message->content_.get()); - if (content->photo_ == nullptr) { - LOG(ERROR) << "Got empty messagePhoto"; - return true; - } - break; - } case td_api::messageChatAddMembers::ID: { auto content = static_cast(message->content_.get()); if (content->member_user_ids_.empty()) { @@ -9592,14 +9584,6 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr(message->content_.get()); - if (content->photo_ == nullptr) { - LOG(ERROR) << "Got empty messageChatChangePhoto"; - return true; - } - break; - } case td_api::messageSupergroupChatCreate::ID: { if (chat->type != ChatInfo::Type::Supergroup) { LOG(ERROR) << "Receive messageSupergroupChatCreate in the non-supergroup chat " << chat_id; @@ -9615,7 +9599,7 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr