mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 17:51:41 -05:00
Show error-by-privacy in adding user as admin.
This commit is contained in:
parent
6f4e31c9c3
commit
c2b2236e64
2 changed files with 6 additions and 18 deletions
|
@ -141,6 +141,11 @@ void ShowAddParticipantsError(
|
|||
return PeerFloodErrorText(isGroup
|
||||
? PeerFloodType::InviteGroup
|
||||
: PeerFloodType::InviteChannel);
|
||||
} else if (error == qstr("ADMINS_TOO_MUCH")) {
|
||||
const auto isGroup = (chat->isChat() || chat->isMegagroup());
|
||||
return lang(isGroup
|
||||
? lng_error_admin_limit
|
||||
: lng_error_admin_limit_channel);
|
||||
}
|
||||
return lang(lng_failed_add_participant);
|
||||
}();
|
||||
|
|
|
@ -131,24 +131,7 @@ void SaveChannelAdmin(
|
|||
onDone();
|
||||
}
|
||||
}).fail([=](const RPCError &error) {
|
||||
if (error.type() == qstr("USER_NOT_MUTUAL_CONTACT")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(PeerFloodErrorText(
|
||||
channel->isMegagroup()
|
||||
? PeerFloodType::InviteGroup
|
||||
: PeerFloodType::InviteChannel)),
|
||||
LayerOption::KeepOther);
|
||||
} else if (error.type() == qstr("BOT_GROUPS_BLOCKED")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(lang(lng_error_cant_add_bot)),
|
||||
LayerOption::KeepOther);
|
||||
} else if (error.type() == qstr("ADMINS_TOO_MUCH")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(lang(channel->isMegagroup()
|
||||
? lng_error_admin_limit
|
||||
: lng_error_admin_limit_channel)),
|
||||
LayerOption::KeepOther);
|
||||
}
|
||||
ShowAddParticipantsError(error.type(), channel, { 1, user });
|
||||
if (onFail) {
|
||||
onFail();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue