diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 2cac04b85..15af0e193 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -867,6 +867,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_background_sure_delete" = "Are you sure you want to delete this background?"; "lng_background_other_info" = "{user} will be able to apply this wallpaper"; "lng_background_other_channel" = "All subscribers will see this wallpaper"; +"lng_background_other_group" = "All members will see this wallpaper"; "lng_background_apply1" = "Apply the wallpaper in this chat."; "lng_background_apply2" = "Enjoy the view."; "lng_background_apply_button" = "Apply For This Chat"; @@ -876,6 +877,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_background_apply_me" = "Apply for me"; "lng_background_apply_both" = "Apply for me and {user}"; "lng_background_apply_channel" = "Apply For Channel"; +"lng_background_apply_group" = "Apply For Group"; "lng_download_path_ask" = "Ask download path for each file"; "lng_download_path" = "Download path"; diff --git a/Telegram/SourceFiles/boxes/background_preview_box.cpp b/Telegram/SourceFiles/boxes/background_preview_box.cpp index cae929641..6dadab562 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/background_preview_box.cpp @@ -467,6 +467,10 @@ bool BackgroundPreviewBox::forChannel() const { return _forPeer && _forPeer->isChannel(); } +bool BackgroundPreviewBox::forGroup() const { + return forChannel() && _forPeer->isMegagroup(); +} + void BackgroundPreviewBox::generateBackground() { if (_paper.backgroundColors().empty()) { return; @@ -492,7 +496,9 @@ void BackgroundPreviewBox::resetTitle() { void BackgroundPreviewBox::rebuildButtons(bool dark) { clearButtons(); - addButton(forChannel() + addButton(forGroup() + ? tr::lng_background_apply_group() + : forChannel() ? tr::lng_background_apply_channel() : _forPeer ? tr::lng_background_apply_button() @@ -1083,7 +1089,9 @@ void BackgroundPreviewBox::updateServiceBg(const std::vector &bg) { _service = GenerateServiceItem( delegate(), _serviceHistory, - (forChannel() + (forGroup() + ? tr::lng_background_other_group(tr::now) + : forChannel() ? tr::lng_background_other_channel(tr::now) : (_forPeer && !_fromMessageId) ? tr::lng_background_other_info( diff --git a/Telegram/SourceFiles/boxes/background_preview_box.h b/Telegram/SourceFiles/boxes/background_preview_box.h index 3eb06d1a5..96150c6ba 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.h +++ b/Telegram/SourceFiles/boxes/background_preview_box.h @@ -95,6 +95,7 @@ private: [[nodiscard]] OverridenStyle prepareOverridenStyle(bool dark); [[nodiscard]] bool forChannel() const; + [[nodiscard]] bool forGroup() const; void checkLevelForChannel(); void recreate(bool dark);