From 3bb8011223e98f31e73e756aa8b2629f7e0092f7 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 11 Jun 2025 19:41:53 +0300 Subject: [PATCH] Update TDLib to 1.8.50. --- td | 2 +- telegram-bot-api/Client.cpp | 19 ++++++++++++++----- telegram-bot-api/Client.h | 4 +++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/td b/td index e6d0516..fb98271 160000 --- a/td +++ b/td @@ -1 +1 @@ -Subproject commit e6d0516e0def13ed6a75ec10b9ac8d4383379245 +Subproject commit fb98271dc674904190a47358cab32fce00948245 diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 249cf43..9bf6fbb 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -3691,6 +3691,8 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const { } case td_api::messageGroupCall::ID: break; + case td_api::messageDirectMessagePriceChanged::ID: + break; default: UNREACHABLE(); } @@ -3703,7 +3705,7 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const { if (!message_->can_be_saved) { object("has_protected_content", td::JsonTrue()); } - if (message_->is_topic_message) { + if (is_topic_message(message_->topic_id)) { object("is_topic_message", td::JsonTrue()); } if (message_->is_from_offline) { @@ -5731,7 +5733,7 @@ class Client::TdOnCheckMessageThreadCallback final : public TdQueryCallback { if (message_info->message_thread_id != message_thread_id_) { return fail_query_with_error(std::move(query_), 400, "MESSAGE_THREAD_INVALID", "Message thread not found"); } - if (!message_info->is_topic_message) { + if (!is_topic_message(message_info->topic_id)) { return fail_query_with_error(std::move(query_), 400, "MESSAGE_THREAD_INVALID", "Message thread is not a forum topic thread"); } @@ -8986,8 +8988,8 @@ td_api::object_ptr Client::get_message_send_options( bool protect_content, bool allow_paid_broadcast, int64 effect_id) { - return make_object(disable_notification, false, protect_content, allow_paid_broadcast, 0, - false, nullptr, effect_id, 0, false); + return make_object(0, disable_notification, false, protect_content, allow_paid_broadcast, + 0, false, nullptr, effect_id, 0, false); } td::Result> Client::get_inline_query_results_button( @@ -15470,6 +15472,8 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr message_info->can_be_saved = message->can_be_saved_; message_info->is_scheduled = message->scheduling_state_ != nullptr; message_info->is_from_offline = message->is_from_offline_; - message_info->is_topic_message = message->is_topic_message_; + message_info->topic_id = std::move(message->topic_id_); message_info->author_signature = std::move(message->author_signature_); message_info->sender_boost_count = message->sender_boost_count_; message_info->paid_message_star_count = message->paid_message_star_count_; @@ -16228,6 +16232,11 @@ td::int64 Client::get_status_custom_emoji_id(const object_ptr &topic_id) { + return topic_id != nullptr && topic_id->get_id() == td_api::messageTopicForum::ID && + static_cast(topic_id.get())->forum_topic_id_ != GENERAL_MESSAGE_THREAD_ID; +} + td::FlatHashMap Client::methods_; } // namespace telegram_bot_api diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 376e9f4..b755ef3 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -1035,6 +1035,7 @@ class Client final : public WebhookActor::Callback { td::unique_ptr business_reply_to_message; object_ptr reply_to_message; object_ptr reply_to_story; + object_ptr topic_id; int64 media_album_id = 0; int64 via_bot_user_id = 0; object_ptr content; @@ -1045,7 +1046,6 @@ class Client final : public WebhookActor::Callback { bool can_be_saved = false; bool is_automatic_forward = false; - bool is_topic_message = false; bool is_from_offline = false; bool is_scheduled = false; mutable bool is_content_changed = false; @@ -1170,6 +1170,8 @@ class Client final : public WebhookActor::Callback { static int64 get_status_custom_emoji_id(const object_ptr &emoji_status); + static bool is_topic_message(const object_ptr &topic); + void add_update_poll(object_ptr &&update); void add_update_poll_answer(object_ptr &&update);