Added manage channel button to profile section of owned channels.

This commit is contained in:
23rd 2024-10-04 09:30:03 +03:00
parent 3cb0be5be5
commit a74c5a89a6
2 changed files with 16 additions and 0 deletions

View file

@ -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.";

View file

@ -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<Ui::RpWidget> 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<FloatingIcon>(
button,
st::menuIconManage,
st::infoChannelAdminsIconPosition);
}
result->setDuration(st::infoSlideDuration)->toggleOn(
rpl::combine(
std::move(membersShown),