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(); }