diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index c2440aa55..0c65409e0 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2227,5 +2227,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_about_text3" = "Visit {channel_link} or {faq_link} for more info."; "ktg_about_text3_channel" = "Kotatogram channel"; "ktg_copy_btn_callback" = "Copy callback data"; +"ktg_profile_copy_id" = "Copy ID"; +"ktg_profile_bot_id" = "Bot ID"; +"ktg_profile_user_id" = "User ID"; +"ktg_profile_group_id" = "Group ID"; +"ktg_profile_supergroup_id" = "Supergroup ID"; +"ktg_profile_channel_id" = "Channel ID"; // Keys finished diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 7eb97088b..6c82a67a4 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -274,6 +274,18 @@ 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, @@ -324,6 +336,23 @@ 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 (!_peer->isSelf()) { diff --git a/Telegram/SourceFiles/info/profile/info_profile_values.cpp b/Telegram/SourceFiles/info/profile/info_profile_values.cpp index 485d66359..fddbf6097 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_values.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_values.cpp @@ -45,6 +45,10 @@ auto PlainUsernameValue(not_null peer) { } // namespace +rpl::producer IDValue(not_null peer) { + return rpl::single(QString("%1").arg(peer->bareId())) | Ui::Text::ToWithEntities(); +} + rpl::producer NameValue(not_null peer) { return Notify::PeerUpdateValue( peer, diff --git a/Telegram/SourceFiles/info/profile/info_profile_values.h b/Telegram/SourceFiles/info/profile/info_profile_values.h index 39bd89d83..711ebb6e0 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_values.h +++ b/Telegram/SourceFiles/info/profile/info_profile_values.h @@ -35,6 +35,7 @@ inline auto ToSingleLine() { rpl::producer> MigratedOrMeValue( not_null peer); +rpl::producer IDValue(not_null peer); rpl::producer NameValue(not_null peer); rpl::producer PhoneValue(not_null user); rpl::producer PhoneOrHiddenValue(not_null user);