Show manage banned and restricted to creator.

This commit is contained in:
John Preston 2017-06-28 08:44:38 +03:00
parent 9e6f2a5d2e
commit b398444b91
2 changed files with 5 additions and 2 deletions

View File

@ -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;
};

View File

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