mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 00:46:08 +00:00
Simplified ranges::find_if with ranges::any_of and ranges::none_of.
This commit is contained in:
@@ -3578,8 +3578,8 @@ void ApiWrap::addChatParticipants(
|
||||
}).afterDelay(crl::time(5)).send();
|
||||
}
|
||||
} else if (const auto channel = peer->asChannel()) {
|
||||
const auto bot = ranges::find_if(users, &UserData::isBot);
|
||||
if (!peer->isMegagroup() && bot != end(users)) {
|
||||
const auto hasBot = ranges::any_of(users, &UserData::isBot);
|
||||
if (!peer->isMegagroup() && hasBot) {
|
||||
ShowAddParticipantsError("USER_BOT", peer, users);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user