Add td_api::linkPreviewType*Boost

This commit is contained in:
levlam 2024-07-03 18:24:32 +03:00
parent c207b266bd
commit b83fa55ee1
2 changed files with 14 additions and 0 deletions

View File

@ -2560,6 +2560,9 @@ 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 boost a channel chat @photo Photo of the chat
linkPreviewTypeChannelBoost photo:chatPhoto = LinkPreviewType;
//@description The link is a link to a Telegram Premium gift code
linkPreviewTypePremiumGiftCode = LinkPreviewType;
@ -2575,6 +2578,9 @@ linkPreviewTypeStory story_sender_chat_id:int53 story_id:int32 = LinkPreviewType
//@description The link is a link to a supergroup chat @photo Photo of the chat
linkPreviewTypeSupergroup photo:chatPhoto = LinkPreviewType;
//@description The link is a link to boost a supergroup chat @photo Photo of the chat
linkPreviewTypeSupergroupBoost photo:chatPhoto = LinkPreviewType;
//@description The link is a link to a cloud theme. TDLib has no theme support yet @documents The list of files with theme description
linkPreviewTypeTheme documents:vector<document> = LinkPreviewType;

View File

@ -1347,12 +1347,20 @@ td_api::object_ptr<td_api::LinkPreviewType> WebPagesManager::get_link_preview_ty
return td_api::make_object<td_api::linkPreviewTypeChannel>(
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_));
}
if (type == "channel_boost") {
return td_api::make_object<td_api::linkPreviewTypeChannelBoost>(
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_));
}
if (type == "chatlist") {
return td_api::make_object<td_api::linkPreviewTypeShareableChatFolder>();
}
if (type == "giftcode") {
return td_api::make_object<td_api::linkPreviewTypePremiumGiftCode>();
}
if (type == "group_boost") {
return td_api::make_object<td_api::linkPreviewTypeSupergroupBoost>(
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_));
}
if (type == "livestream") {
return td_api::make_object<td_api::linkPreviewTypeVideoChat>(
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_), true);