diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 3d87e78d3..d101b4c93 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -255,6 +255,18 @@ object_ptr DetailsFiller::setupInfo() { return result; }; if (const auto user = _peer->asUser()) { + if (user->isBot()) { + addInfoOneLine( + tr::ktg_profile_bot_id(), + IDValue(user), + tr::ktg_profile_copy_id(tr::now)); + } else { + addInfoOneLine( + tr::ktg_profile_user_id(), + IDValue(user), + tr::ktg_profile_copy_id(tr::now)); + } + if (user->session().supportMode()) { addInfoLineGeneric( user->session().supportHelper().infoLabelValue(user), @@ -275,18 +287,6 @@ object_ptr DetailsFiller::setupInfo() { UsernameValue(user), tr::lng_context_copy_mention(tr::now)); - if (user->isBot()) { - addInfoOneLine( - tr::ktg_profile_bot_id(), - IDValue(user), - tr::ktg_profile_copy_id(tr::now)); - } else { - addInfoOneLine( - tr::ktg_profile_user_id(), - IDValue(user), - tr::ktg_profile_copy_id(tr::now)); - } - const auto window = &_controller->parentController()->window(); AddMainButton( result, @@ -295,6 +295,23 @@ object_ptr DetailsFiller::setupInfo() { [=] { window->show(Box(EditContactBox, window, user)); }, tracker); } else { + if (_peer->isChat()) { + addInfoOneLine( + tr::ktg_profile_group_id(), + IDValue(_peer), + tr::ktg_profile_copy_id(tr::now)); + } else if (_peer->isMegagroup()) { + addInfoOneLine( + tr::ktg_profile_supergroup_id(), + IDValue(_peer), + tr::ktg_profile_copy_id(tr::now)); + } else { + addInfoOneLine( + tr::ktg_profile_channel_id(), + IDValue(_peer), + tr::ktg_profile_copy_id(tr::now)); + } + auto linkText = LinkValue( _peer ) | rpl::map([](const QString &link) { @@ -337,23 +354,6 @@ object_ptr DetailsFiller::setupInfo() { )->setLinksTrusted(); } - if (_peer->isChat()) { - addInfoOneLine( - tr::ktg_profile_group_id(), - IDValue(_peer), - tr::ktg_profile_copy_id(tr::now)); - } else if (_peer->isMegagroup()) { - addInfoOneLine( - tr::ktg_profile_supergroup_id(), - IDValue(_peer), - tr::ktg_profile_copy_id(tr::now)); - } else { - addInfoOneLine( - tr::ktg_profile_channel_id(), - IDValue(_peer), - tr::ktg_profile_copy_id(tr::now)); - } - addInfoLine(tr::lng_info_about_label(), AboutValue(_peer)); if (const auto channel = _peer->asChannel()) {