mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add IV icon to the button.
This commit is contained in:
@@ -3544,9 +3544,13 @@ void Session::webpageApplyFields(
|
||||
process(block, process);
|
||||
}
|
||||
}
|
||||
const auto type = story ? WebPageType::Story : ParseWebPageType(data);
|
||||
auto iv = (data.vcached_page() && !IgnoreIv(type))
|
||||
? std::make_unique<Iv::Data>(data, *data.vcached_page())
|
||||
: nullptr;
|
||||
webpageApplyFields(
|
||||
page,
|
||||
(story ? WebPageType::Story : ParseWebPageType(data)),
|
||||
type,
|
||||
qs(data.vurl()),
|
||||
qs(data.vdisplay_url()),
|
||||
siteName,
|
||||
@@ -3564,9 +3568,7 @@ void Session::webpageApplyFields(
|
||||
? processDocument(*document).get()
|
||||
: lookupThemeDocument()),
|
||||
WebPageCollage(this, data),
|
||||
(data.vcached_page()
|
||||
? std::make_unique<Iv::Data>(data, *data.vcached_page())
|
||||
: nullptr),
|
||||
std::move(iv),
|
||||
data.vduration().value_or_empty(),
|
||||
qs(data.vauthor().value_or_empty()),
|
||||
data.is_has_large_media(),
|
||||
|
@@ -171,6 +171,10 @@ WebPageType ParseWebPageType(
|
||||
}
|
||||
}
|
||||
|
||||
bool IgnoreIv(WebPageType type) {
|
||||
return (type == WebPageType::Message);
|
||||
}
|
||||
|
||||
WebPageType ParseWebPageType(const MTPDwebPage &page) {
|
||||
return ParseWebPageType(
|
||||
qs(page.vtype().value_or_empty()),
|
||||
|
@@ -53,6 +53,7 @@ enum class WebPageType : uint8 {
|
||||
Livestream,
|
||||
};
|
||||
[[nodiscard]] WebPageType ParseWebPageType(const MTPDwebPage &type);
|
||||
[[nodiscard]] bool IgnoreIv(WebPageType type);
|
||||
|
||||
struct WebPageCollage {
|
||||
using Item = std::variant<PhotoData*, DocumentData*>;
|
||||
|
Reference in New Issue
Block a user