Do not count deleted users and bots in online member count just in case.

GitOrigin-RevId: 9c4b5fd5df66b8e963b5ae64dd01a6d9e1b4adc6
This commit is contained in:
levlam 2019-03-09 18:32:43 +03:00
parent 5707d5b277
commit dc06fcb7fb

View File

@ -7168,7 +7168,7 @@ void ContactsManager::update_chat_online_member_count(const ChatFull *chat_full,
int32 time = G()->unix_time(); int32 time = G()->unix_time();
for (const auto &participant : chat_full->participants) { for (const auto &participant : chat_full->participants) {
auto u = get_user(participant.user_id); auto u = get_user(participant.user_id);
if (u != nullptr) { if (u != nullptr && !u->is_deleted && !u->is_bot) {
int32 was_online = u->was_online; int32 was_online = u->was_online;
if (participant.user_id == get_my_id() && my_was_online_local_ != 0) { if (participant.user_id == get_my_id() && my_was_online_local_ != 0) {
was_online = my_was_online_local_; was_online = my_was_online_local_;