From 3cd05a34d900a3ee0844fa0075eec73f7f019644 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 12 Feb 2021 14:47:09 +0400 Subject: [PATCH] In legacy groups admins can't remove admins. --- Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index f777344c05..c74dfa173c 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -359,7 +359,9 @@ bool ParticipantsAdditionalData::canRemoveUser( if (canRestrictUser(user)) { return true; } else if (const auto chat = _peer->asChat()) { - return !user->isSelf() && chat->invitedByMe.contains(user); + return !user->isSelf() + && chat->invitedByMe.contains(user) + && (chat->amCreator() || !_admins.contains(user)); } return false; }