From 16117e56bb91c6775a224042322d832aab080c75 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 24 Jul 2023 22:10:21 +0300 Subject: [PATCH] Added phrase for public photo to short info box. --- Telegram/Resources/langs/lang.strings | 1 + .../SourceFiles/boxes/peers/prepare_short_info_box.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 5e7f85bc6..15c8eff5f 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1144,6 +1144,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_copy_phone" = "Copy Phone Number"; "lng_profile_copy_fullname" = "Copy Name"; "lng_profile_photo_by_you" = "photo set by you"; +"lng_profile_public_photo" = "public photo"; "lng_via_link_group_one" = "**{user}** restricts adding them to groups.\nYou can send them an invite link as message instead."; "lng_via_link_group_many#one" = "**{count} user** restricts adding them to groups.\nYou can send them an invite link as message instead."; diff --git a/Telegram/SourceFiles/boxes/peers/prepare_short_info_box.cpp b/Telegram/SourceFiles/boxes/peers/prepare_short_info_box.cpp index 9965e8810..dfe8bdf72 100644 --- a/Telegram/SourceFiles/boxes/peers/prepare_short_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/prepare_short_info_box.cpp @@ -335,10 +335,14 @@ bool ProcessCurrent( : state->photoView ? state->photoView->owner().get() : nullptr; - state->current.additionalStatus = ((state->photoId == userpicPhotoId) - && peer->isUser() + state->current.additionalStatus = (!peer->isUser()) + ? QString() + : ((state->photoId == userpicPhotoId) && peer->asUser()->hasPersonalPhoto()) ? tr::lng_profile_photo_by_you(tr::now) + : ((state->current.index == (state->current.count - 1)) + && SyncUserFallbackPhotoViewer(peer->asUser())) + ? tr::lng_profile_public_photo(tr::now) : QString(); state->waitingLoad = false; if (!changedPhotoId