From 20da7d23f2309308d593e2510ed131b47757e9d3 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 1 May 2025 01:27:34 +0300 Subject: [PATCH] Update TDLib to 1.8.48. --- td | 2 +- telegram-bot-api/Client.cpp | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/td b/td index a03a904..b8b08b0 160000 --- a/td +++ b/td @@ -1 +1 @@ -Subproject commit a03a90470d6fca9a5a3db747ba3f3e4a465b5fe7 +Subproject commit b8b08b02dbbc0c05e7129e2f306c636c5b8ec04f diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 79c4843..b77f28a 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -3134,7 +3134,7 @@ class Client::JsonExternalReplyInfo final : public td::Jsonable { } case td_api::messageStory::ID: { auto content = static_cast(reply_->content_.get()); - object("story", JsonStory(content->story_sender_chat_id_, content->story_id_, client_)); + object("story", JsonStory(content->story_poster_chat_id_, content->story_id_, client_)); break; } default: @@ -3267,7 +3267,7 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const { } if (message_->reply_to_story != nullptr) { object("reply_to_story", - JsonStory(message_->reply_to_story->story_sender_chat_id_, message_->reply_to_story->story_id_, client_)); + JsonStory(message_->reply_to_story->story_poster_chat_id_, message_->reply_to_story->story_id_, client_)); } if (message_->media_album_id != 0) { object("media_group_id", td::to_string(message_->media_album_id)); @@ -3615,7 +3615,7 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const { } case td_api::messageStory::ID: { auto content = static_cast(message_->content.get()); - object("story", JsonStory(content->story_sender_chat_id_, content->story_id_, client_)); + object("story", JsonStory(content->story_poster_chat_id_, content->story_id_, client_)); break; } case td_api::messageChatSetBackground::ID: { @@ -3681,6 +3681,8 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const { object("paid_message_price_changed", JsonPaidMessagePriceChanged(content)); break; } + case td_api::messageGroupCall::ID: + break; default: UNREACHABLE(); } @@ -5391,7 +5393,7 @@ class Client::TdOnGetStoryCallback final : public TdQueryCallback { CHECK(result->get_id() == td_api::story::ID); auto story = static_cast(result.get()); - answer_query(JsonStory(story->sender_chat_id_, story->id_, client_), std::move(query_)); + answer_query(JsonStory(story->poster_chat_id_, story->id_, client_), std::move(query_)); } private: @@ -7748,14 +7750,14 @@ void Client::on_update(object_ptr result) { std::move(update->error_)); break; } - case td_api::updateStorySendSucceeded::ID: { - auto update = move_object_as(result); + case td_api::updateStoryPostSucceeded::ID: { + auto update = move_object_as(result); on_story_send_succeeded(std::move(update->story_), update->old_story_id_); break; } - case td_api::updateStorySendFailed::ID: { - auto update = move_object_as(result); - on_story_send_failed(update->story_->sender_chat_id_, update->story_->id_, std::move(update->error_)); + case td_api::updateStoryPostFailed::ID: { + auto update = move_object_as(result); + on_story_send_failed(update->story_->poster_chat_id_, update->story_->id_, std::move(update->error_)); break; } case td_api::updateMessageContent::ID: { @@ -11113,12 +11115,12 @@ void Client::on_message_send_failed(int64 chat_id, int64 old_message_id, int64 n } void Client::on_story_send_succeeded(object_ptr &&story, int64 old_story_id) { - auto full_story_id = FullMessageId{story->sender_chat_id_, old_story_id}; + auto full_story_id = FullMessageId{story->poster_chat_id_, old_story_id}; auto yet_unsent_story_it = yet_unsent_stories_.find(full_story_id); CHECK(yet_unsent_story_it != yet_unsent_stories_.end()); auto query = std::move(yet_unsent_story_it->second.query); yet_unsent_stories_.erase(yet_unsent_story_it); - answer_query(JsonStory(story->sender_chat_id_, story->id_, this), std::move(query)); + answer_query(JsonStory(story->poster_chat_id_, story->id_, this), std::move(query)); } void Client::on_story_send_failed(int64 chat_id, int64 story_id, object_ptr &&error) { @@ -12174,7 +12176,7 @@ td::Status Client::process_post_story_query(PromisedQueryPtr &query) { 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(business_connection->user_chat_id_, std::move(content), std::move(areas), + make_object(business_connection->user_chat_id_, std::move(content), std::move(areas), std::move(caption), make_object(), active_period, nullptr, is_posted_to_chat_page, protect_content), td::make_unique(this, std::move(query))); @@ -14250,7 +14252,7 @@ void Client::on_sent_message(object_ptr &&message, int64 query_ void Client::on_sent_story(object_ptr &&story, PromisedQueryPtr query) { CHECK(story != nullptr); - int64 chat_id = story->sender_chat_id_; + int64 chat_id = story->poster_chat_id_; int64 story_id = story->id_; FullMessageId full_story_id{chat_id, story_id}; @@ -15455,6 +15457,8 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr