From 65057a9802ee849e59c683b6cdc8d090cc853961 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 28 Jul 2024 22:06:46 +0300 Subject: [PATCH] Add width and height to linkPreviewTypeEmbeddedAudioPlayer. --- td/generate/scheme/td_api.tl | 8 +++++--- td/telegram/WebPagesManager.cpp | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index caf036c19..dd8fa2b7c 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2614,15 +2614,17 @@ linkPreviewTypeDocument document:document author:string = LinkPreviewType; //@thumbnail Thumbnail of the audio; may be null if unknown //@duration Duration of the audio, in seconds //@author Author of the audio -linkPreviewTypeEmbeddedAudioPlayer url:string thumbnail:photo duration:int32 author:string = LinkPreviewType; +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedAudioPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType; //@description The link is a link to a video player //@url URL of the external video player //@thumbnail Thumbnail of the video; may be null if unknown //@duration Duration of the video, in seconds //@author Author of the video -//@width Expected width of the preview -//@height Expected height of the preview +//@width Expected width of the embedded player +//@height Expected height of the embedded player linkPreviewTypeEmbeddedVideoPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType; //@description The link is a link to an invoice diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index d8df197e7..293cd5ee4 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -1543,7 +1543,7 @@ td_api::object_ptr WebPagesManager::get_link_preview_ty if (web_page->type_ == "audio") { return td_api::make_object( web_page->embed_url_, get_photo_object(td_->file_manager_.get(), web_page->photo_), web_page->duration_, - web_page->author_); + web_page->author_, web_page->embed_dimensions_.width, web_page->embed_dimensions_.height); } if (web_page->type_ == "video") { return td_api::make_object( @@ -1836,7 +1836,8 @@ td_api::object_ptr WebPagesManager::get_link_preview_object } return td_api::make_object( web_page->url_, web_page->display_url_, web_page->site_name_, web_page->title_, - get_formatted_text_object(td_->user_manager_.get(), description, true, duration == 0 ? std::numeric_limits::max() : duration), + get_formatted_text_object(td_->user_manager_.get(), description, true, + duration == 0 ? std::numeric_limits::max() : duration), std::move(link_preview_type), web_page->has_large_media_, show_large_media, show_media_above_description, skip_confirmation, invert_media, instant_view_version); }