Show correct error for discuss groups.

This commit is contained in:
John Preston
2024-09-27 18:21:18 +04:00
parent a37f512949
commit e6b76fefa1
2 changed files with 6 additions and 2 deletions
@@ -1129,11 +1129,14 @@ void ShowEditPeerPermissionsBox(
disabledByAdminRights,
tr::lng_rights_permission_cant_edit(tr::now));
if (const auto channel = peer->asChannel()) {
if (channel->isPublic()
|| (channel->isMegagroup() && channel->linkedChat())) {
if (channel->isPublic()) {
result.emplace(
Flag::ChangeInfo | Flag::PinMessages,
tr::lng_rights_permission_unavailable(tr::now));
} else if (channel->isMegagroup() && channel->linkedChat()) {
result.emplace(
Flag::ChangeInfo | Flag::PinMessages,
tr::lng_rights_permission_in_discuss(tr::now));
}
}
return result;