Add td_api::linkPreviewTypeUser.
This commit is contained in:
parent
7489967137
commit
2d0d07aaae
@ -2587,6 +2587,9 @@ 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;
|
||||
|
||||
//@description The link is a link to a user @photo Photo of the user; may be null if none @is_bot True, if the user is a bot
|
||||
linkPreviewTypeUser photo:chatPhoto is_bot:Bool = LinkPreviewType;
|
||||
|
||||
//@description The link is a link to a video chat
|
||||
//@photo Photo of the chat with the video chat; may be null if none
|
||||
//@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group
|
||||
|
@ -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 == "bot") {
|
||||
return td_api::make_object<td_api::linkPreviewTypeUser>(
|
||||
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_), true);
|
||||
}
|
||||
if (type == "channel" || type == "channel_request") {
|
||||
return td_api::make_object<td_api::linkPreviewTypeChat>(
|
||||
td_api::make_object<td_api::inviteLinkChatTypeChannel>(),
|
||||
@ -1408,6 +1412,10 @@ td_api::object_ptr<td_api::LinkPreviewType> WebPagesManager::get_link_preview_ty
|
||||
// TODO add theme settings
|
||||
return td_api::make_object<td_api::linkPreviewTypeTheme>(std::move(documents));
|
||||
}
|
||||
if (type == "user") {
|
||||
return td_api::make_object<td_api::linkPreviewTypeUser>(
|
||||
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_), false);
|
||||
}
|
||||
if (type == "videochat") {
|
||||
return td_api::make_object<td_api::linkPreviewTypeVideoChat>(
|
||||
get_chat_photo_object(td_->file_manager_.get(), web_page->photo_), false);
|
||||
|
Loading…
Reference in New Issue
Block a user