Add Message.reply_to_story.

This commit is contained in:
levlam 2024-02-15 11:20:57 +03:00
parent c7adc690e4
commit 656152f1f1
2 changed files with 10 additions and 0 deletions

View File

@ -2499,6 +2499,10 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
if (message_->reply_to_message != nullptr && message_->reply_to_message->quote_ != nullptr) { if (message_->reply_to_message != nullptr && message_->reply_to_message->quote_ != nullptr) {
object("quote", JsonTextQuote(message_->reply_to_message->quote_.get(), client_)); object("quote", JsonTextQuote(message_->reply_to_message->quote_.get(), client_));
} }
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_));
}
if (message_->media_album_id != 0) { if (message_->media_album_id != 0) {
object("media_group_id", td::to_string(message_->media_album_id)); object("media_group_id", td::to_string(message_->media_album_id));
} }
@ -12899,6 +12903,11 @@ Client::FullMessageId Client::add_message(object_ptr<td_api::message> &&message,
} else { } else {
message_info->reply_to_message = nullptr; message_info->reply_to_message = nullptr;
} }
if (message->reply_to_ != nullptr && message->reply_to_->get_id() == td_api::messageReplyToStory::ID) {
message_info->reply_to_story = move_object_as<td_api::messageReplyToStory>(message->reply_to_);
} else {
message_info->reply_to_story = nullptr;
}
if (message_info->content == nullptr || force_update_content) { if (message_info->content == nullptr || force_update_content) {
message_info->content = std::move(message->content_); message_info->content = std::move(message->content_);

View File

@ -875,6 +875,7 @@ class Client final : public WebhookActor::Callback {
object_ptr<td_api::MessageOrigin> forward_origin; object_ptr<td_api::MessageOrigin> forward_origin;
td::string author_signature; td::string author_signature;
object_ptr<td_api::messageReplyToMessage> reply_to_message; object_ptr<td_api::messageReplyToMessage> reply_to_message;
object_ptr<td_api::messageReplyToStory> reply_to_story;
int64 media_album_id = 0; int64 media_album_id = 0;
int64 via_bot_user_id = 0; int64 via_bot_user_id = 0;
object_ptr<td_api::MessageContent> content; object_ptr<td_api::MessageContent> content;