Allow to use addChatMembers with one user in basic groups.

This commit is contained in:
levlam 2023-12-08 14:30:01 +03:00
parent 559cbe5de9
commit d8eab25e82
1 changed files with 3 additions and 0 deletions

View File

@ -18779,6 +18779,9 @@ void ContactsManager::add_dialog_participants(DialogId dialog_id, const vector<U
case DialogType::User:
return promise.set_error(Status::Error(400, "Can't add members to a private chat"));
case DialogType::Chat:
if (user_ids.size() == 1) {
return add_chat_participant(dialog_id.get_chat_id(), user_ids[0], 0, std::move(promise));
}
return promise.set_error(Status::Error(400, "Can't add many members at once to a basic group chat"));
case DialogType::Channel:
return add_channel_participants(dialog_id.get_channel_id(), user_ids, std::move(promise));