Highlight primary usernames in profiles like the additional ones.

This commit is contained in:
John Preston 2022-11-21 16:53:52 +00:00
parent ab06574fd9
commit 2de76cb75b

View file

@ -372,13 +372,22 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
const auto usernameLine = addInfoOneLine(
UsernamesSubtext(_peer, tr::lng_info_username_label()),
UsernameValue(user, true),
tr::lng_context_copy_mention(tr::now),
UsernameValue(user, true) | rpl::map([=](TextWithEntities u) {
return u.text.isEmpty()
? TextWithEntities()
: Ui::Text::Link(
u,
user->session().createInternalLinkFull(
u.text.mid(1)));
}),
QString(),
st::infoProfileLabeledUsernamePadding);
usernameLine.subtext->overrideLinkClickHandler(UsernamesLinkCallback(
const auto callback = UsernamesLinkCallback(
_peer,
Window::Show(controller),
QString()));
QString());
usernameLine.text->overrideLinkClickHandler(callback);
usernameLine.subtext->overrideLinkClickHandler(callback);
const auto usernameLabel = usernameLine.text;
if (user->isBot()) {
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(