Improve getRepliedMessage.

This commit is contained in:
levlam 2022-11-13 03:13:11 +03:00
parent 1d672470ea
commit f6f94e5255
2 changed files with 4 additions and 1 deletions

View File

@ -4893,7 +4893,7 @@ getMessage chat_id:int53 message_id:int53 = Message;
//@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get //@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get
getMessageLocally chat_id:int53 message_id:int53 = Message; getMessageLocally chat_id:int53 message_id:int53 = Message;
//@description Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively //@description Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and service topic messages respectively
//@chat_id Identifier of the chat the message belongs to @message_id Identifier of the reply message //@chat_id Identifier of the chat the message belongs to @message_id Identifier of the reply message
getRepliedMessage chat_id:int53 message_id:int53 = Message; getRepliedMessage chat_id:int53 message_id:int53 = Message;

View File

@ -18446,6 +18446,9 @@ FullMessageId MessagesManager::get_replied_message_id(DialogId dialog_id, const
return full_message_id; return full_message_id;
} }
if (m->reply_to_message_id == MessageId()) { if (m->reply_to_message_id == MessageId()) {
if (m->top_thread_message_id.is_valid() && is_service_message_content(m->content->get_type())) {
return {dialog_id, m->top_thread_message_id};
}
return {}; return {};
} }
return {m->reply_in_dialog_id.is_valid() ? m->reply_in_dialog_id : dialog_id, m->reply_to_message_id}; return {m->reply_in_dialog_id.is_valid() ? m->reply_in_dialog_id : dialog_id, m->reply_to_message_id};