Add td_api::linkPreviewTypeArticle.

This commit is contained in:
levlam 2024-07-04 16:24:45 +03:00
parent 5c4ccdb1d6
commit d193456bf2
2 changed files with 7 additions and 0 deletions

View File

@ -2559,6 +2559,9 @@ linkPreviewTypeAnimation animation:animation author:string = LinkPreviewType;
//@description The link is a link to an app at App Store or Google Play @photo Photo for the app @author Author of the app //@description The link is a link to an app at App Store or Google Play @photo Photo for the app @author Author of the app
linkPreviewTypeApp photo:photo author:string = LinkPreviewType; linkPreviewTypeApp photo:photo author:string = LinkPreviewType;
//@description The link is a link to a web site @photo Article's main photo; may be null @author Author of the article
linkPreviewTypeArticle photo:photo author:string = LinkPreviewType;
//@description The link is a link to an audio //@description The link is a link to an audio
//@url URL of the audio; may be empty if none //@url URL of the audio; may be empty if none
//@mime_type MIME type of the audio file //@mime_type MIME type of the audio file

View File

@ -1469,6 +1469,10 @@ td_api::object_ptr<td_api::LinkPreviewType> WebPagesManager::get_link_preview_ty
return td_api::make_object<td_api::linkPreviewTypeApp>(get_photo_object(td_->file_manager_.get(), web_page->photo_), return td_api::make_object<td_api::linkPreviewTypeApp>(get_photo_object(td_->file_manager_.get(), web_page->photo_),
web_page->author_); web_page->author_);
} }
if (web_page->type_ == "article") {
return td_api::make_object<td_api::linkPreviewTypeArticle>(
get_photo_object(td_->file_manager_.get(), web_page->photo_), web_page->author_);
}
if (web_page->type_ == "gif" || if (web_page->type_ == "gif" ||
(web_page->document_.type == Document::Type::Animation && web_page->type_ == "document")) { (web_page->document_.type == Document::Type::Animation && web_page->type_ == "document")) {
auto animation = web_page->document_.type == Document::Type::Animation auto animation = web_page->document_.type == Document::Type::Animation