Add td_api::linkPreviewTypeChannel.

This commit is contained in:
levlam 2024-07-03 18:16:15 +03:00
parent 85758c069d
commit c207b266bd
2 changed files with 7 additions and 0 deletions

View File

@ -2557,6 +2557,9 @@ webPageInstantView page_blocks:vector<PageBlock> view_count:int32 version:int32
//@document Document with the background; may be null for filled backgrounds
linkPreviewTypeBackground document:document = LinkPreviewType;
//@description The link is a link to a channel chat @photo Photo of the chat
linkPreviewTypeChannel photo:chatPhoto = LinkPreviewType;
//@description The link is a link to a Telegram Premium gift code
linkPreviewTypePremiumGiftCode = LinkPreviewType;

View File

@ -1343,6 +1343,10 @@ td_api::object_ptr<td_api::LinkPreviewType> WebPagesManager::get_link_preview_ty
? td_->documents_manager_->get_document_object(web_page->document_.file_id, PhotoFormat::Png)
: nullptr);
}
if (type == "channel") {
return td_api::make_object<td_api::linkPreviewTypeChannel>(
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_));
}
if (type == "chatlist") {
return td_api::make_object<td_api::linkPreviewTypeShareableChatFolder>();
}