added ADMINS_TOO_MUCH error handle (when adding too much admins to a channel)

This commit is contained in:
John Preston 2015-10-29 12:02:13 -04:00
parent 59abcc2986
commit 087e2970cd
2 changed files with 4 additions and 1 deletions

View File

@ -430,6 +430,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
"lng_channel_admins" = "Administrators";
"lng_channel_add_admin" = "Add Administrator";
"lng_channel_admin_sure" = "Add {user} to administrators?";
"lng_channel_admins_too_much" = "Sorry, you have reached the limit of channel administrators. Please remove some administrator first.";
"lng_participant_filter" = "Search";
"lng_participant_invite" = "Invite";

View File

@ -199,7 +199,9 @@ bool ContactsInner::addAdminFail(const RPCError &error, mtpRequestId req) {
_addAdminRequestId = 0;
if (error.type() == "USERS_TOO_MUCH") {
App::wnd()->replaceLayer(new MaxInviteBox(_channel->invitationUrl));
} else {
} else if (error.type() == "ADMINS_TOO_MUCH") {
App::wnd()->replaceLayer(new InformBox(lang(lng_channel_admins_too_much)));
} else {
if (_addAdminBox) _addAdminBox->onClose();
emit adminAdded();
}