Support link preview in reply media content.

This commit is contained in:
levlam 2023-10-29 00:57:50 +03:00
parent 6e217d1aac
commit 0737f3b741
2 changed files with 7 additions and 5 deletions

View File

@ -1233,9 +1233,9 @@ messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool re
//@is_quote_manual True, if the quote was manually chosen by the message sender
//@origin Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat
//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat
//@content Media content of the message if the message was replied from another chat; may be null for messages from the same chat and non-media messages.
//-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageInvoice,
//-messageLocation, messagePhoto, messagePoll, messageSticker, messageStory, messageVenue, messageVideo, messageVideoNote, or messageVoiceNote
//@content Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media.
//-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation,
//-messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote
messageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText is_quote_manual:Bool origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo;
//@description Describes a story replied by a given message @story_sender_chat_id The identifier of the sender of the story @story_id The identifier of the story

View File

@ -119,7 +119,7 @@ RepliedMessageInfo::RepliedMessageInfo(Td *td, tl_object_ptr<telegram_api::messa
case MessageContentType::Poll:
case MessageContentType::Sticker:
case MessageContentType::Story:
// case MessageContentType::Text:
case MessageContentType::Text:
case MessageContentType::Unsupported:
case MessageContentType::Venue:
case MessageContentType::Video:
@ -282,7 +282,9 @@ td_api::object_ptr<td_api::messageReplyToMessage> RepliedMessageInfo::get_messag
td_api::object_ptr<td_api::MessageContent> content;
if (content_ != nullptr) {
content = get_message_content_object(content_.get(), td, dialog_id, 0, false, true, -1, false);
if (content->get_id() == td_api::messageUnsupported::ID) {
if (content->get_id() == td_api::messageUnsupported::ID ||
(content->get_id() == td_api::messageText::ID &&
static_cast<const td_api::messageText *>(content.get())->web_page_ == nullptr)) {
content = nullptr;
}
}