From b398444b919244a8e990e3f9f5e05fbc79f9a7fd Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 28 Jun 2017 08:44:38 +0300 Subject: [PATCH] Show manage banned and restricted to creator. --- Telegram/SourceFiles/profile/profile_block_settings.cpp | 4 ++-- Telegram/SourceFiles/structs.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/profile/profile_block_settings.cpp b/Telegram/SourceFiles/profile/profile_block_settings.cpp index 7dc94fc8e..25a572a23 100644 --- a/Telegram/SourceFiles/profile/profile_block_settings.cpp +++ b/Telegram/SourceFiles/profile/profile_block_settings.cpp @@ -156,7 +156,7 @@ void SettingsWidget::refreshManageAdminsButton() { void SettingsWidget::refreshManageBannedUsersButton() { auto hasManageBannedUsers = [this] { if (auto channel = peer()->asMegagroup()) { - return channel->hasAdminRights() && (channel->kickedCount() > 0); + return channel->canViewBanned() && (channel->kickedCount() > 0); } return false; }; @@ -169,7 +169,7 @@ void SettingsWidget::refreshManageBannedUsersButton() { auto hasManageRestrictedUsers = [this] { if (auto channel = peer()->asMegagroup()) { - return channel->hasAdminRights() && (channel->restrictedCount() > 0); + return channel->canViewBanned() && (channel->restrictedCount() > 0); } return false; }; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 7c9e8d7e3..9b867e48b 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -892,6 +892,9 @@ public: bool canViewAdmins() const { return (isMegagroup() || hasAdminRights() || amCreator()); } + bool canViewBanned() const { + return (hasAdminRights() || amCreator()); + } bool canEditInformation() const { return adminRights().is_change_info() || amCreator(); }