mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Add view button to channel boost link previews.
This commit is contained in:
parent
7828a92f08
commit
c5634580f6
4 changed files with 7 additions and 0 deletions
|
@ -3875,6 +3875,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_view_button_voice_chat_channel" = "Live stream";
|
||||
"lng_view_button_request_join" = "Request to Join";
|
||||
"lng_view_button_external_link" = "Open link";
|
||||
"lng_view_button_boost" = "Boost";
|
||||
|
||||
"lng_sponsored_hide_ads" = "Hide";
|
||||
"lng_sponsored_title" = "What are sponsored messages?";
|
||||
|
|
|
@ -176,6 +176,8 @@ WebPageType ParseWebPageType(
|
|||
return WebPageType::User;
|
||||
} else if (type == u"telegram_botapp"_q) {
|
||||
return WebPageType::BotApp;
|
||||
} else if (type == u"telegram_channel_boost"_q) {
|
||||
return WebPageType::ChannelBoost;
|
||||
} else if (hasIV) {
|
||||
return WebPageType::ArticleWithIV;
|
||||
} else {
|
||||
|
|
|
@ -23,6 +23,7 @@ enum class WebPageType {
|
|||
GroupWithRequest,
|
||||
Channel,
|
||||
ChannelWithRequest,
|
||||
ChannelBoost,
|
||||
|
||||
Photo,
|
||||
Video,
|
||||
|
|
|
@ -68,6 +68,8 @@ inline auto WebPageToPhrase(not_null<WebPageData*> webpage) {
|
|||
: (type == WebPageType::GroupWithRequest
|
||||
|| type == WebPageType::ChannelWithRequest)
|
||||
? tr::lng_view_button_request_join(tr::now)
|
||||
: (type == WebPageType::ChannelBoost)
|
||||
? tr::lng_view_button_boost(tr::now)
|
||||
: (type == WebPageType::VoiceChat)
|
||||
? tr::lng_view_button_voice_chat(tr::now)
|
||||
: (type == WebPageType::Livestream)
|
||||
|
@ -177,6 +179,7 @@ bool ViewButton::MediaHasViewButton(
|
|||
return (type == WebPageType::Message)
|
||||
|| (type == WebPageType::Group)
|
||||
|| (type == WebPageType::Channel)
|
||||
|| (type == WebPageType::ChannelBoost)
|
||||
// || (type == WebPageType::Bot)
|
||||
|| (type == WebPageType::User)
|
||||
|| (type == WebPageType::VoiceChat)
|
||||
|
|
Loading…
Add table
Reference in a new issue