Remove duplicate linkPreview fields.

This commit is contained in:
levlam 2024-07-04 18:42:50 +03:00
parent cc1861568b
commit a31b27c456
2 changed files with 3 additions and 36 deletions

View File

@ -2676,22 +2676,12 @@ linkPreviewTypeWebApp photo:photo = LinkPreviewType;
//@title Title of the content
//@param_description Description of the content
//@type Type of the link preview
//@photo Image representing the content; may be null
//@duration Duration of the content, in seconds
//@author Author of the content
//@has_large_media True, if size of media in the preview can be changed
//@show_large_media True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos
//@skip_confirmation True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear
//@show_above_text True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text
//@animation Preview of the content as an animation, if available; may be null
//@audio Preview of the content as an audio file, if available; may be null
//@document Preview of the content as a document, if available; may be null
//@sticker Preview of the content as a sticker for small WEBP files, if available; may be null
//@video Preview of the content as a video, if available; may be null
//@video_note Preview of the content as a video note, if available; may be null
//@voice_note Preview of the content as a voice note, if available; may be null
//@instant_view_version Version of instant view (currently, can be 1 or 2) for the web page; 0 if none
linkPreview url:string display_url:string site_name:string title:string description:formattedText type:LinkPreviewType photo:photo duration:int32 author:string has_large_media:Bool show_large_media:Bool skip_confirmation:Bool show_above_text:Bool animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = LinkPreview;
linkPreview url:string display_url:string site_name:string title:string description:formattedText type:LinkPreviewType has_large_media:Bool show_large_media:Bool skip_confirmation:Bool show_above_text:Bool instant_view_version:int32 = LinkPreview;
//@description Contains information about a country

View File

@ -1736,31 +1736,8 @@ td_api::object_ptr<td_api::linkPreview> WebPagesManager::get_link_preview_object
return td_api::make_object<td_api::linkPreview>(
web_page->url_, web_page->display_url_, web_page->site_name_, web_page->title_,
get_formatted_text_object(description, true, duration == 0 ? std::numeric_limits<int32>::max() : duration),
get_link_preview_type_object(web_page, force_small_media, force_large_media),
get_photo_object(td_->file_manager_.get(), web_page->photo_), web_page->duration_, web_page->author_,
web_page->has_large_media_, show_large_media, skip_confirmation, invert_media,
web_page->document_.type == Document::Type::Animation
? td_->animations_manager_->get_animation_object(web_page->document_.file_id)
: nullptr,
web_page->document_.type == Document::Type::Audio
? td_->audios_manager_->get_audio_object(web_page->document_.file_id)
: nullptr,
web_page->document_.type == Document::Type::General
? td_->documents_manager_->get_document_object(web_page->document_.file_id, PhotoFormat::Jpeg)
: nullptr,
web_page->document_.type == Document::Type::Sticker
? td_->stickers_manager_->get_sticker_object(web_page->document_.file_id)
: nullptr,
web_page->document_.type == Document::Type::Video
? td_->videos_manager_->get_video_object(web_page->document_.file_id)
: nullptr,
web_page->document_.type == Document::Type::VideoNote
? td_->video_notes_manager_->get_video_note_object(web_page->document_.file_id)
: nullptr,
web_page->document_.type == Document::Type::VoiceNote
? td_->voice_notes_manager_->get_voice_note_object(web_page->document_.file_id)
: nullptr,
instant_view_version);
get_link_preview_type_object(web_page, force_small_media, force_large_media), web_page->has_large_media_,
show_large_media, skip_confirmation, invert_media, instant_view_version);
}
td_api::object_ptr<td_api::webPageInstantView> WebPagesManager::get_web_page_instant_view_object(