Add td_api::linkPreviewTypeTheme.

This commit is contained in:
levlam 2024-07-03 16:31:26 +03:00
parent 5b9bfcd67e
commit 6b408d486c
2 changed files with 14 additions and 1 deletions

View File

@ -2565,6 +2565,9 @@ linkPreviewTypeShareableChatFolder = LinkPreviewType;
//@description The link is a link to a sticker set @stickers Up to 4 stickers from the sticker set //@description The link is a link to a sticker set @stickers Up to 4 stickers from the sticker set
linkPreviewTypeStickerSet stickers:vector<sticker> = LinkPreviewType; linkPreviewTypeStickerSet stickers:vector<sticker> = 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;
//@description The link preview type is unsupported yet @type String type of the link preview. Can be: article, photo, audio, video, document, profile, app, or something else //@description The link preview type is unsupported yet @type String type of the link preview. Can be: article, photo, audio, video, document, profile, app, or something else
linkPreviewTypeOther type:string = LinkPreviewType; linkPreviewTypeOther type:string = LinkPreviewType;
@ -6398,7 +6401,7 @@ internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = In
//@story_id Story identifier //@story_id Story identifier
internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType; internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType;
//@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme //@description The link is a link to a cloud theme. TDLib has no theme support yet @theme_name Name of the theme
internalLinkTypeTheme theme_name:string = InternalLinkType; internalLinkTypeTheme theme_name:string = InternalLinkType;
//@description The link is a link to the theme section of the app settings //@description The link is a link to the theme section of the app settings

View File

@ -1355,6 +1355,16 @@ td_api::object_ptr<td_api::LinkPreviewType> WebPagesManager::get_link_preview_ty
}); });
return td_api::make_object<td_api::linkPreviewTypeStickerSet>(std::move(stickers)); return td_api::make_object<td_api::linkPreviewTypeStickerSet>(std::move(stickers));
} }
if (type == "theme") {
vector<td_api::object_ptr<td_api::document>> documents;
for (auto &document : web_page->documents_) {
if (document.type == Document::Type::General) {
documents.push_back(td_->documents_manager_->get_document_object(document.file_id, PhotoFormat::Jpeg));
}
}
// TODO add theme settings
return td_api::make_object<td_api::linkPreviewTypeTheme>(std::move(documents));
}
} }
// TODO LOG(ERROR) << "Receive link preview of unsupported type " << web_page->type_; // TODO LOG(ERROR) << "Receive link preview of unsupported type " << web_page->type_;
return td_api::make_object<td_api::linkPreviewTypeOther>(web_page->type_); return td_api::make_object<td_api::linkPreviewTypeOther>(web_page->type_);