Use "My Story" instead of name in viewer.

This commit is contained in:
John Preston 2023-07-20 19:10:10 +04:00
parent dd9ea29334
commit 7e18ecfb78
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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;