From 86c0205faa6e9e3a49e6c465b05c16b283426107 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 24 Nov 2017 20:33:06 +0400 Subject: [PATCH] Handle USERS_TOO_FEW error in group creation. --- Telegram/SourceFiles/boxes/add_contact_box.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index 2c5ba4dc3..f06d0c072 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -394,6 +394,9 @@ void GroupInfoBox::createGroup(not_null selectUsersBox, const QStr inputs.push_back(user->inputUser); } } + if (inputs.empty()) { + return; + } _creationRequestId = request(MTPmessages_CreateChat(MTP_vector(inputs), MTP_string(title))).done([this](const MTPUpdates &result) { Ui::hideLayer(); @@ -439,6 +442,9 @@ void GroupInfoBox::createGroup(not_null selectUsersBox, const QStr _title->showError(); } } else if (error.type() == qstr("USERS_TOO_FEW")) { + Ui::show( + Box(lang(lng_cant_invite_privacy)), + LayerOption::KeepOther); } else if (error.type() == qstr("PEER_FLOOD")) { Ui::show( Box(