2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Use UserData::isBot where applicable.

This commit is contained in:
John Preston
2019-07-18 10:51:11 +02:00
parent a7d9aa947b
commit 873b77cf40
29 changed files with 105 additions and 95 deletions

View File

@@ -200,7 +200,7 @@ void ChannelData::applyEditAdmin(
if (!base::contains(mgInfo->lastParticipants, user)) {
mgInfo->lastParticipants.push_front(user);
setMembersCount(membersCount() + 1);
if (user->botInfo && !mgInfo->bots.contains(user)) {
if (user->isBot() && !mgInfo->bots.contains(user)) {
mgInfo->bots.insert(user);
if (mgInfo->botStatus != 0 && mgInfo->botStatus < 2) {
mgInfo->botStatus = 2;
@@ -242,7 +242,7 @@ void ChannelData::applyEditAdmin(
if (adminsCount() > 1) {
setAdminsCount(adminsCount() - 1);
}
if (!isMegagroup() && user->botInfo && membersCount() > 1) {
if (!isMegagroup() && user->isBot() && membersCount() > 1) {
// Removing bot admin removes it from channel.
setMembersCount(membersCount() - 1);
}