mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-28 09:32:56 +00:00
Show error when adding a non-group bot to admins.
This commit is contained in:
parent
f7543e3261
commit
9344504781
@ -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.";
|
||||
|
@ -685,12 +685,17 @@ void AddParticipantBoxController::editAdmin(gsl::not_null<UserData*> 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<InformBox>(PeerFloodErrorText(channel->isMegagroup() ? PeerFloodType::InviteGroup : PeerFloodType::InviteChannel)), KeepOtherLayers);
|
||||
} else if (error.type() == qstr("BOT_GROUPS_BLOCKED")) {
|
||||
Ui::show(Box<InformBox>(lang(lng_error_cant_add_bot)), KeepOtherLayers);
|
||||
}
|
||||
if (weak && weak->_editBox) {
|
||||
weak->_editBox->closeBox();
|
||||
}
|
||||
return true;
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user