From 7e18ecfb7858d4353dca23860e54ba47af59dbac Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 20 Jul 2023 19:10:10 +0400 Subject: [PATCH] Use "My Story" instead of name in viewer. --- Telegram/SourceFiles/media/stories/media_stories_header.cpp | 4 +++- Telegram/SourceFiles/media/stories/media_stories_sibling.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/media/stories/media_stories_header.cpp b/Telegram/SourceFiles/media/stories/media_stories_header.cpp index 654d54102c..5dafcb9e73 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_header.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_header.cpp @@ -236,7 +236,9 @@ void UserpicBadge::updateGeometry() { } [[nodiscard]] TextWithEntities ComposeName(HeaderData data) { - auto result = Ui::Text::Bold(data.user->shortName()); + auto result = Ui::Text::Bold(data.user->isSelf() + ? tr::lng_stories_my_name(tr::now) + : data.user->shortName()); if (data.fullCount) { result.append(QString::fromUtf8(" \xE2\x80\xA2 %1/%2" ).arg(data.fullIndex + 1 diff --git a/Telegram/SourceFiles/media/stories/media_stories_sibling.cpp b/Telegram/SourceFiles/media/stories/media_stories_sibling.cpp index b8eda7d4ae..0da0049938 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_sibling.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_sibling.cpp @@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_photo_media.h" #include "data/data_session.h" #include "data/data_user.h" +#include "lang/lang_keys.h" #include "main/main_session.h" #include "media/stories/media_stories_controller.h" #include "media/stories/media_stories_view.h" @@ -339,7 +340,9 @@ QImage Sibling::nameImage(const SiblingLayout &layout) { .linkFontOver = font, }); }; - const auto text = _peer->shortName(); + const auto text = _peer->isSelf() + ? tr::lng_stories_my_name(tr::now) + : _peer->shortName(); if (_nameText != text) { _name.reset(); _nameText = text;