Allow anonymous administrators without other rights.

GitOrigin-RevId: 9d9276b0950a0cabf15d8148747df5da9a0c3c1d
This commit is contained in:
levlam 2020-09-28 01:35:49 +03:00
parent 605a968e51
commit cee879803b

View File

@ -47,13 +47,12 @@ DialogParticipantStatus DialogParticipantStatus::Administrator(bool is_anonymous
(static_cast<uint32>(can_invite_users) * CAN_INVITE_USERS_ADMIN) |
(static_cast<uint32>(can_restrict_members) * CAN_RESTRICT_MEMBERS) |
(static_cast<uint32>(can_pin_messages) * CAN_PIN_MESSAGES_ADMIN) |
(static_cast<uint32>(can_promote_members) * CAN_PROMOTE_MEMBERS);
(static_cast<uint32>(can_promote_members) * CAN_PROMOTE_MEMBERS) |
(static_cast<uint32>(is_anonymous) * IS_ANONYMOUS);
if (flags == 0 || flags == CAN_BE_EDITED) {
return Member();
}
return DialogParticipantStatus(Type::Administrator,
IS_MEMBER | ALL_RESTRICTED_RIGHTS | flags | (is_anonymous ? IS_ANONYMOUS : 0), 0,
std::move(rank));
return DialogParticipantStatus(Type::Administrator, IS_MEMBER | ALL_RESTRICTED_RIGHTS | flags, 0, std::move(rank));
}
DialogParticipantStatus DialogParticipantStatus::Member() {