Update TDLib to 1.8.7 and support extended_media in sendInvoice.

This commit is contained in:
levlam 2022-09-23 20:29:42 +03:00
parent 834caf09bf
commit 254ad97805
6 changed files with 13 additions and 8 deletions

2
td

@ -1 +1 @@
Subproject commit cb70993b90ce84c16dea07c347835addbff46a2c
Subproject commit a7a17b34b3c8fd3f7f6295f152746beb68f34d83

View File

@ -5619,7 +5619,7 @@ td::Result<td_api::object_ptr<td_api::InputMessageContent>> Client::get_input_me
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());
td::string(), nullptr);
}
if (is_input_message_content_required) {
@ -6750,7 +6750,7 @@ td::Result<td::vector<td_api::object_ptr<td_api::InputMessageContent>>> Client::
return std::move(contents);
}
td::Result<td_api::object_ptr<td_api::inputMessageInvoice>> Client::get_input_message_invoice(const Query *query) {
td::Result<td_api::object_ptr<td_api::inputMessageInvoice>> Client::get_input_message_invoice(const Query *query) const {
TRY_RESULT(title, get_required_string_arg(query, "title"));
TRY_RESULT(description, get_required_string_arg(query, "description"));
TRY_RESULT(payload, get_required_string_arg(query, "payload"));
@ -6806,13 +6806,18 @@ td::Result<td_api::object_ptr<td_api::inputMessageInvoice>> Client::get_input_me
auto send_email_address_to_provider = to_bool(query->arg("send_email_to_provider"));
auto is_flexible = to_bool(query->arg("is_flexible"));
td_api::object_ptr<td_api::InputMessageContent> extended_media;
if (!query->arg("extended_media").empty()) {
TRY_RESULT_ASSIGN(extended_media, get_input_media(query, "extended_media"));
}
return make_object<td_api::inputMessageInvoice>(
make_object<td_api::invoice>(currency.str(), std::move(prices), max_tip_amount, std::move(suggested_tip_amounts),
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.str(), description.str(), photo_url.str(), photo_size, photo_width, photo_height, payload.str(),
provider_token.str(), provider_data.str(), start_parameter.str());
provider_token.str(), provider_data.str(), start_parameter.str(), std::move(extended_media));
}
td::Result<td::vector<td::string>> Client::get_poll_options(const Query *query) {

View File

@ -445,7 +445,7 @@ class Client final : public WebhookActor::Callback {
td::Result<td::vector<object_ptr<td_api::InputMessageContent>>> get_input_message_contents(
const Query *query, td::JsonValue &&value) const;
static td::Result<object_ptr<td_api::inputMessageInvoice>> get_input_message_invoice(const Query *query);
td::Result<object_ptr<td_api::inputMessageInvoice>> get_input_message_invoice(const Query *query) const;
static object_ptr<td_api::messageSendOptions> get_message_send_options(bool disable_notification,
bool protect_content);

View File

@ -244,7 +244,7 @@ void ClientManager::get_stats(td::Promise<td::BufferSlice> promise,
auto *client_info = clients_.get(top_bot_id.second);
CHECK(client_info);
auto bot_info = client_info->client_->get_actor_unsafe()->get_bot_info();
auto bot_info = client_info->client_.get_actor_unsafe()->get_bot_info();
auto active_request_count = client_info->stat_.get_active_request_count();
auto active_file_upload_bytes = client_info->stat_.get_active_file_upload_bytes();
sb << '\n';

View File

@ -21,7 +21,7 @@ namespace telegram_bot_api {
void HttpConnection::handle(td::unique_ptr<td::HttpQuery> http_query,
td::ActorOwn<td::HttpInboundConnection> connection) {
CHECK(connection_->empty());
CHECK(connection_.empty());
connection_ = std::move(connection);
LOG(DEBUG) << "Handle " << *http_query;

View File

@ -15,7 +15,7 @@ namespace telegram_bot_api {
void HttpStatConnection::handle(td::unique_ptr<td::HttpQuery> http_query,
td::ActorOwn<td::HttpInboundConnection> connection) {
CHECK(connection_->empty());
CHECK(connection_.empty());
connection_ = std::move(connection);
auto promise = td::PromiseCreator::lambda([actor_id = actor_id(this)](td::Result<td::BufferSlice> result) {