diff --git a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp index d23abb04c6..7f82a7f3bb 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp @@ -308,7 +308,7 @@ void EditAdminBox::prepare() { }, lifetime()); if (canTransferOwnership()) { - const auto allFlags = FullAdminRights(isGroup); + const auto allFlags = AdminRightsForOwnershipTransfer(isGroup); setupTransferButton( isGroup )->toggleOn(rpl::duplicate( diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp index 29ac53e516..91e0a0dfe0 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp @@ -298,10 +298,12 @@ ChatRestrictions FixDependentRestrictions(ChatRestrictions restrictions) { return restrictions; } -ChatAdminRights FullAdminRights(bool isGroup) { +ChatAdminRights AdminRightsForOwnershipTransfer(bool isGroup) { auto result = ChatAdminRights(); for (const auto &[flag, label] : AdminRightLabels(isGroup, true)) { - result |= flag; + if (!(flag & ChatAdminRight::f_anonymous)) { + result |= flag; + } } return result; } diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h index 53f16ea38e..b7dfd4ed07 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h @@ -71,4 +71,4 @@ EditFlagsControl CreateEditAdminRights( ChatAdminRights DisabledByDefaultRestrictions(not_null peer); ChatRestrictions FixDependentRestrictions(ChatRestrictions restrictions); -ChatAdminRights FullAdminRights(bool isGroup); +ChatAdminRights AdminRightsForOwnershipTransfer(bool isGroup);