mirror of https://github.com/procxx/kepka.git
Show error-by-privacy in adding user as admin.
This commit is contained in:
parent
6f4e31c9c3
commit
c2b2236e64
|
@ -141,6 +141,11 @@ void ShowAddParticipantsError(
|
||||||
return PeerFloodErrorText(isGroup
|
return PeerFloodErrorText(isGroup
|
||||||
? PeerFloodType::InviteGroup
|
? PeerFloodType::InviteGroup
|
||||||
: PeerFloodType::InviteChannel);
|
: 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);
|
return lang(lng_failed_add_participant);
|
||||||
}();
|
}();
|
||||||
|
|
|
@ -131,24 +131,7 @@ void SaveChannelAdmin(
|
||||||
onDone();
|
onDone();
|
||||||
}
|
}
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
if (error.type() == qstr("USER_NOT_MUTUAL_CONTACT")) {
|
ShowAddParticipantsError(error.type(), channel, { 1, user });
|
||||||
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);
|
|
||||||
}
|
|
||||||
if (onFail) {
|
if (onFail) {
|
||||||
onFail();
|
onFail();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue