From cee879803b179d3cf6e490c9b56257d08bfe16e2 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 28 Sep 2020 01:35:49 +0300 Subject: [PATCH] Allow anonymous administrators without other rights. GitOrigin-RevId: 9d9276b0950a0cabf15d8148747df5da9a0c3c1d --- td/telegram/DialogParticipant.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/td/telegram/DialogParticipant.cpp b/td/telegram/DialogParticipant.cpp index 61a40606b..e37c42beb 100644 --- a/td/telegram/DialogParticipant.cpp +++ b/td/telegram/DialogParticipant.cpp @@ -47,13 +47,12 @@ DialogParticipantStatus DialogParticipantStatus::Administrator(bool is_anonymous (static_cast(can_invite_users) * CAN_INVITE_USERS_ADMIN) | (static_cast(can_restrict_members) * CAN_RESTRICT_MEMBERS) | (static_cast(can_pin_messages) * CAN_PIN_MESSAGES_ADMIN) | - (static_cast(can_promote_members) * CAN_PROMOTE_MEMBERS); + (static_cast(can_promote_members) * CAN_PROMOTE_MEMBERS) | + (static_cast(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() {