2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Hide Add Users checkbox if megagroup is democracy.

Also unite invite_users and invite_link flags.
This commit is contained in:
John Preston
2017-06-14 13:58:54 +03:00
parent adcecaa195
commit 04e587b999
3 changed files with 14 additions and 8 deletions

View File

@@ -864,8 +864,11 @@ public:
bool canDeleteMessages() const {
return adminRights().is_delete_messages() || amCreator();
}
bool anyoneCanAddMembers() const {
return (flags & MTPDchannel::Flag::f_democracy);
}
bool canAddMembers() const {
return adminRights().is_invite_users() || amCreator() || (amIn() && (flags & MTPDchannel::Flag::f_democracy));
return adminRights().is_invite_users() || amCreator() || (anyoneCanAddMembers() && amIn() && !hasRestrictedRights());
}
bool canAddAdmins() const {
return adminRights().is_add_admins() || amCreator();