From bfb2f3015ac1a00d80f3b43fa322efce1d7d1134 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 13 Nov 2025 14:46:20 +0300 Subject: [PATCH] Added action button to profile top bar for direct messages. --- Telegram/Resources/langs/lang.strings | 1 + .../info/profile/info_profile_top_bar.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index c2dbf4ba1b..0baa9ac0c5 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1686,6 +1686,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_changed_photo_link" = "Settings"; "lng_profile_action_short_message" = "Message"; +"lng_profile_action_short_channel" = "Channel"; "lng_profile_action_short_mute" = "Mute"; "lng_profile_action_short_unmute" = "Unmute"; "lng_profile_action_short_call" = "Call"; diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index ff6dd60b5d..747bc8cb07 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -704,6 +704,18 @@ void TopBar::setupActions(not_null controller) { }); buttons.push_back(join); _actions->add(join); + } else if (const auto channel = peer->monoforumBroadcast()) { + const auto message = Ui::CreateChild( + this, + tr::lng_profile_action_short_channel(tr::now), + st::infoProfileTopBarActionMessage); + message->setClickedCallback([=, window = controller] { + window->showPeerHistory( + channel, + Window::SectionShow::Way::Forward); + }); + buttons.push_back(message); + _actions->add(message); } { const auto notifications = Ui::CreateChild(