From 6487d917220347380a3b8c30af39d5cca9207e53 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 28 Jun 2017 10:07:49 +0300 Subject: [PATCH] Add users to a channel check by admin rights. Also add an admin right checkbox for add users in channels. --- Telegram/SourceFiles/boxes/edit_participant_box.cpp | 1 + Telegram/SourceFiles/boxes/members_box.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/edit_participant_box.cpp index f59a4e756..77a275278 100644 --- a/Telegram/SourceFiles/boxes/edit_participant_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_participant_box.cpp @@ -212,6 +212,7 @@ void EditAdminBox::prepare() { addCheckbox(Flag::f_post_messages, lang(lng_rights_channel_post)); addCheckbox(Flag::f_edit_messages, lang(lng_rights_channel_edit)); addCheckbox(Flag::f_delete_messages, lang(lng_rights_channel_delete)); + addCheckbox(Flag::f_invite_users | Flag::f_invite_link, lang(lng_rights_group_invite)); addCheckbox(Flag::f_add_admins, lang(lng_rights_add_admins)); } diff --git a/Telegram/SourceFiles/boxes/members_box.cpp b/Telegram/SourceFiles/boxes/members_box.cpp index e5f6c5fc7..beca6bd45 100644 --- a/Telegram/SourceFiles/boxes/members_box.cpp +++ b/Telegram/SourceFiles/boxes/members_box.cpp @@ -102,7 +102,7 @@ void MembersBox::refreshButtons() { if (_channel->canAddAdmins()) { addLeftButton(langFactory(lng_channel_add_admin), [this] { onAdd(); }); } - } else if (_channel->amCreator() && (_channel->membersCount() < (_channel->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax()) || (!_channel->isMegagroup() && !_channel->isPublic()))) { + } else if (_channel->canAddMembers() && (_channel->membersCount() < (_channel->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax()) || (!_channel->isMegagroup() && !_channel->isPublic()))) { addLeftButton(langFactory(lng_channel_add_members), [this] { onAdd(); }); } }