Add animated emoji premium preview.

This commit is contained in:
John Preston 2022-07-15 12:45:44 +03:00
parent 66b2bdd656
commit 3ccc567e04
5 changed files with 25 additions and 2 deletions

View File

@ -232,6 +232,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_sticker_premium_text" = "This pack contains premium stickers like this one.";
"lng_sticker_premium_view" = "View";
"lng_animated_emoji_text" = "Subscribe to **Telegram Premium** to unlock this emoji.";
"lng_reaction_premium_info" = "Click on the reaction to preview the animation.";
"lng_reaction_premium_no_group" = "Some reactions are restricted in this group.";
"lng_reaction_premium_no_channel" = "Some reactions are restricted in this channel.";
@ -1692,6 +1693,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_more_about" = "More About Telegram Premium";
"lng_premium_unlock_reactions" = "Unlock Premium Reactions";
"lng_premium_unlock_stickers" = "Unlock Premium Stickers";
"lng_premium_unlock_emoji" = "Unlock Animated Emoji";
"lng_premium_summary_title" = "Telegram Premium";
"lng_premium_summary_top_about" = "Go **beyond the limits**, get **exclusive features** and support us by subscribing to **Telegram Premium**.";
@ -1710,6 +1712,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_summary_about_unique_reactions" = "Additional animated reactions on messages available only to the Premium subscribers.";
"lng_premium_summary_subtitle_premium_stickers" = "Premium Stickers";
"lng_premium_summary_about_premium_stickers" = "Exclusive enlarged stickers featuring additional effects, updated monthly.";
"lng_premium_summary_subtitle_animated_emoji" = "Animated Emoji";
"lng_premium_summary_about_animated_emoji" = "Include animated emoji from different emoji sets in any message you send.";
"lng_premium_summary_subtitle_advanced_chat_management" = "Advanced Chat Management";
"lng_premium_summary_about_advanced_chat_management" = "Tools to set default folder, auto-archive and hide new chats from non-contacts.";
"lng_premium_summary_subtitle_profile_badge" = "Profile Badge";
@ -2143,6 +2147,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_delete_all_files" = "Delete all files";
"lng_context_save_custom_sound" = "Save for notifications";
"lng_context_animated_emoji" = "This message contains emoji from {name} pack.";
"lng_context_animated_emoji_many" = "This message contains emoji from {name} packs.";
"lng_downloads_section" = "Downloads";
"lng_downloads_view_in_chat" = "View in chat";
"lng_downloads_view_in_section" = "View in downloads";

View File

@ -122,6 +122,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
return tr::lng_premium_summary_subtitle_unique_reactions();
case PremiumPreview::Stickers:
return tr::lng_premium_summary_subtitle_premium_stickers();
case PremiumPreview::AnimatedEmoji:
return tr::lng_premium_summary_subtitle_animated_emoji();
case PremiumPreview::AdvancedChatManagement:
return tr::lng_premium_summary_subtitle_advanced_chat_management();
case PremiumPreview::ProfileBadge:
@ -146,6 +148,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
return tr::lng_premium_summary_about_unique_reactions();
case PremiumPreview::Stickers:
return tr::lng_premium_summary_about_premium_stickers();
case PremiumPreview::AnimatedEmoji:
return tr::lng_premium_summary_about_animated_emoji();
case PremiumPreview::AdvancedChatManagement:
return tr::lng_premium_summary_about_advanced_chat_management();
case PremiumPreview::ProfileBadge:
@ -443,7 +447,8 @@ struct VideoPreviewDocument {
[[nodiscard]] bool VideoAlignToTop(PremiumPreview section) {
return (section == PremiumPreview::MoreUpload)
|| (section == PremiumPreview::NoAds);
|| (section == PremiumPreview::NoAds)
|| (section == PremiumPreview::AnimatedEmoji);
}
[[nodiscard]] DocumentData *LookupVideo(
@ -455,6 +460,7 @@ struct VideoPreviewDocument {
case PremiumPreview::FasterDownload: return "faster_download";
case PremiumPreview::VoiceToText: return "voice_to_text";
case PremiumPreview::NoAds: return "no_ads";
case PremiumPreview::AnimatedEmoji: return "animated_emoji";
case PremiumPreview::AdvancedChatManagement:
return "advanced_chat_management";
case PremiumPreview::ProfileBadge: return "profile_badge";

View File

@ -36,6 +36,7 @@ enum class PremiumPreview {
NoAds,
Reactions,
Stickers,
AnimatedEmoji,
AdvancedChatManagement,
ProfileBadge,
AnimatedUserpics,

View File

@ -179,7 +179,7 @@ emojiSwitchColor: windowActiveTextFg;
emojiSwitchStickers: icon {{ "emoji/emoji_switch", emojiSwitchColor }};
emojiSwitchEmoji: icon {{ "emoji/emoji_switch-flip_horizontal", emojiSwitchColor }};
emojiIconPadding: 8px;
emojiIconPadding: 7px;
emojiIconSelectSkip: 3px;
hashtagClose: IconButton {

View File

@ -143,6 +143,15 @@ using Order = std::vector<QString>;
PremiumPreview::Stickers,
},
},
{
u"animated_emoji"_q,
Entry{
&st::settingsIconEmoji,
tr::lng_premium_summary_subtitle_animated_emoji(),
tr::lng_premium_summary_about_animated_emoji(),
PremiumPreview::AnimatedEmoji,
},
},
{
u"advanced_chat_management"_q,
Entry{