From a74c5a89a651f5e71916d50da887cdec7637f828 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 4 Oct 2024 09:30:03 +0300 Subject: [PATCH] Added manage channel button to profile section of owned channels. --- Telegram/Resources/langs/lang.strings | 1 + .../info/profile/info_profile_actions.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 52fd1c48e..60cdcc65c 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1381,6 +1381,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_public_photo" = "public photo"; "lng_profile_administrators#one" = "{count} administrator"; "lng_profile_administrators#other" = "{count} administrators"; +"lng_profile_manage" = "Channel settings"; "lng_invite_upgrade_title" = "Upgrade to Premium"; "lng_invite_upgrade_group_invite#one" = "{users} only accepts invitations to groups from Contacts and **Premium** users."; diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index da41978b9..8a3380726 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/peers/add_bot_to_chat_box.h" #include "boxes/peers/edit_contact_box.h" #include "boxes/peers/edit_participants_box.h" +#include "boxes/peers/edit_peer_info_box.h" #include "boxes/report_messages_box.h" #include "boxes/share_box.h" #include "boxes/star_gift_box.h" @@ -2340,6 +2341,20 @@ object_ptr SetupChannelMembersAndManage( st::menuIconAdmin, st::infoChannelAdminsIconPosition); + if (EditPeerInfoBox::Available(channel)) { + const auto sessionController = controller->parentController(); + const auto button = AddActionButton( + result->entity(), + tr::lng_profile_manage(), + rpl::single(true), + [=] { sessionController->showEditPeerBox(channel); }, + nullptr); + object_ptr( + button, + st::menuIconManage, + st::infoChannelAdminsIconPosition); + } + result->setDuration(st::infoSlideDuration)->toggleOn( rpl::combine( std::move(membersShown),