From b8c300b05b69a458d4bd354ceca6c23aa248e55a Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 21 Apr 2020 21:08:59 +0300 Subject: [PATCH] Fix updating of channel member count. GitOrigin-RevId: f6f49994937d68bbe175a619d37d19900de756f6 --- td/telegram/ContactsManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index aaf49731..38355ec2 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -9080,8 +9080,8 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c return promise.set_value(Unit()); } - auto participant_count = - (channel_full->flags_ & CHANNEL_FULL_FLAG_HAS_PARTICIPANT_COUNT) != 0 ? channel_full->participants_count_ : 0; + bool have_participant_count = (channel_full->flags_ & CHANNEL_FULL_FLAG_HAS_PARTICIPANT_COUNT) != 0; + auto participant_count = have_participant_count ? channel_full->participants_count_ : 0; auto administrator_count = (channel_full->flags_ & CHANNEL_FULL_FLAG_HAS_ADMINISTRATOR_COUNT) != 0 ? channel_full->admins_count_ : 0; auto restricted_count = @@ -9127,7 +9127,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c channel->is_changed = true; - if (participant_count != 0 && c->participant_count != participant_count) { + if (have_participant_count && c->participant_count != participant_count) { c->participant_count = participant_count; c->is_changed = true; update_channel(c, channel_id);