From 85758c069d2d3aa714c58497c6e588bbe3d79f66 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 3 Jul 2024 18:15:07 +0300 Subject: [PATCH] Add td_api::linkPreviewTypeSupergroup. --- td/generate/scheme/td_api.tl | 3 +++ td/telegram/WebPagesManager.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 2be1f06ec..8d6d29f89 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2569,6 +2569,9 @@ linkPreviewTypeStickerSet stickers:vector = LinkPreviewType; //@description The link is a link to a story. Link preview description is unavailable @story_sender_chat_id The identifier of the chat that posted the story @story_id Story identifier 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 a cloud theme. TDLib has no theme support yet @documents The list of files with theme description linkPreviewTypeTheme documents:vector = LinkPreviewType; diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 02056514a..ee2a6568e 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -1353,6 +1353,10 @@ td_api::object_ptr WebPagesManager::get_link_preview_ty return td_api::make_object( get_chat_photo_object(td_->file_manager_.get(), web_page->photo_), true); } + if (type == "megagroup") { + return td_api::make_object( + get_chat_photo_object(td_->file_manager_.get(), web_page->photo_)); + } if (type == "stickerset") { auto stickers = transform(web_page->sticker_ids_, [&](FileId sticker_id) { return td_->stickers_manager_->get_sticker_object(sticker_id);