2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix permissions dependencies.

This commit is contained in:
John Preston
2019-02-13 15:18:03 +03:00
parent ae6c152988
commit 5ec80238a0
3 changed files with 41 additions and 11 deletions

View File

@@ -327,11 +327,12 @@ void EditRestrictedBox::prepare() {
const auto prepareRights = (_oldRights.c_chatBannedRights().vflags.v
? _oldRights
: Defaults(peer()));
const auto prepareFlags = prepareRights.c_chatBannedRights().vflags.v
const auto prepareFlags = FixDependentRestrictions(
prepareRights.c_chatBannedRights().vflags.v
| defaultRestrictions
| ((channel && channel->isPublic())
? (Flag::f_change_info | Flag::f_pin_messages)
: Flags(0));
: Flags(0)));
const auto disabledMessages = [&] {
auto result = std::map<Flags, QString>();
if (!canSave()) {
@@ -339,10 +340,11 @@ void EditRestrictedBox::prepare() {
~Flags(0),
lang(lng_rights_about_restriction_cant_edit));
} else {
const auto disabled = defaultRestrictions
const auto disabled = FixDependentRestrictions(
defaultRestrictions
| ((channel && channel->isPublic())
? (Flag::f_change_info | Flag::f_pin_messages)
: Flags(0));
: Flags(0)));
result.emplace(
disabled,
lang(lng_rights_restriction_for_all));