Fix rights check in generateChatInviteLink.
GitOrigin-RevId: 241f4368ea9baabe479655959f724eb4b591c9e4
This commit is contained in:
parent
e4a0d5937a
commit
66bf58ca0e
@ -4580,7 +4580,7 @@ void ContactsManager::export_chat_invite_link(ChatId chat_id, Promise<Unit> &&pr
|
||||
return promise.set_error(Status::Error(3, "Chat is deactivated"));
|
||||
}
|
||||
|
||||
if (!get_chat_status(c).can_invite_users()) {
|
||||
if (!get_chat_status(c).is_administrator() || !get_chat_status(c).can_invite_users()) {
|
||||
return promise.set_error(Status::Error(3, "Not enough rights to export chat invite link"));
|
||||
}
|
||||
|
||||
@ -4593,7 +4593,7 @@ void ContactsManager::export_channel_invite_link(ChannelId channel_id, Promise<U
|
||||
return promise.set_error(Status::Error(3, "Chat info not found"));
|
||||
}
|
||||
|
||||
if (!get_channel_status(c).can_invite_users()) {
|
||||
if (!get_channel_status(c).is_administrator() || !get_channel_status(c).can_invite_users()) {
|
||||
return promise.set_error(Status::Error(3, "Not enough rights to export chat invite link"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user