diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index afad151373..ae12ca141c 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1674,6 +1674,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_action_short_mute" = "Mute"; "lng_profile_action_short_unmute" = "Unmute"; "lng_profile_action_short_call" = "Call"; +"lng_profile_action_short_discuss" = "Discuss"; "lng_media_type_photos" = "Photos"; "lng_media_type_gifs" = "GIFs"; diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index 0ad2ec7b96..336a5eeafb 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -493,6 +493,25 @@ void TopBar::setupActions(not_null controller) { user->updateFull(); } } + if (const auto chat = channel ? channel->discussionLink() : nullptr) { + const auto navigation = controller->parentController(); + const auto discuss = Ui::CreateChild( + this, + tr::lng_profile_action_short_discuss(tr::now), + st::infoProfileTopBarActionMessage); + discuss->setClickedCallback([=] { + if (channel->invitePeekExpires()) { + controller->showToast( + tr::lng_channel_invite_private(tr::now)); + return; + } + navigation->showPeerHistory( + chat, + Window::SectionShow::Way::Forward); + }); + _actions->add(discuss); + buttons.push_back(discuss); + } _edgeColor.value() | rpl::map(mapped) | rpl::start_with_next([=]( QColor c) { for (const auto &button : buttons) {