diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index aa6119ae59..02dadf73bc 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -145,6 +145,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org "lng_error_public_groups_denied" = "Unfortunately, you were banned from participating in public groups.\n{more_info}"; "lng_error_cant_edit_admin" = "Sorry, you can't edit permissions for this admin."; "lng_error_cant_add_member" = "Sorry, you can't add the bot to this group. Ask a group admin to do it."; +"lng_error_cant_add_bot" = "Sorry, this bot can't be added to groups."; "lng_error_cant_add_admin_invite" = "Sorry, you can't add this user as an admin because they are not a member of this group and you are not allowed to invite them."; "lng_error_cant_add_admin_unban" = "Sorry, you can't add this user as an admin because they are in the blacklist and you can't unban them."; "lng_error_cant_ban_admin" = "Sorry, you can't ban this user because they are an admin in this group and you are not allowed to demote them."; diff --git a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp index 862921ecda..10f11fcf7f 100644 --- a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp +++ b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp @@ -685,12 +685,17 @@ void AddParticipantBoxController::editAdmin(gsl::not_null user, bool if (weak) { weak->editAdminDone(user, newRights); } - }), rpcFail([channel](const RPCError &error) { + }), rpcFail([channel, weak](const RPCError &error) { if (MTP::isDefaultHandledError(error)) { return false; } if (error.type() == qstr("USER_NOT_MUTUAL_CONTACT")) { Ui::show(Box(PeerFloodErrorText(channel->isMegagroup() ? PeerFloodType::InviteGroup : PeerFloodType::InviteChannel)), KeepOtherLayers); + } else if (error.type() == qstr("BOT_GROUPS_BLOCKED")) { + Ui::show(Box(lang(lng_error_cant_add_bot)), KeepOtherLayers); + } + if (weak && weak->_editBox) { + weak->_editBox->closeBox(); } return true; }));