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