Use server-side online count for supergroups with hidden members.
This commit is contained in:
parent
db761e0852
commit
89c407c129
@ -13073,7 +13073,9 @@ void MessagesManager::on_update_dialog_online_member_count_timeout(DialogId dial
|
||||
|
||||
if (dialog_id.get_type() == DialogType::Channel && !is_broadcast_channel(dialog_id)) {
|
||||
auto participant_count = td_->contacts_manager_->get_channel_participant_count(dialog_id.get_channel_id());
|
||||
if (participant_count == 0 || participant_count >= 195) {
|
||||
auto has_hidden_participants =
|
||||
td_->contacts_manager_->get_channel_has_hidden_participants(dialog_id.get_channel_id());
|
||||
if (participant_count == 0 || participant_count >= 195 || has_hidden_participants) {
|
||||
td_->create_handler<GetOnlinesQuery>()->send(dialog_id);
|
||||
} else {
|
||||
td_->contacts_manager_->get_channel_participants(dialog_id.get_channel_id(),
|
||||
@ -21607,7 +21609,9 @@ void MessagesManager::open_dialog(Dialog *d) {
|
||||
auto channel_id = dialog_id.get_channel_id();
|
||||
if (!is_broadcast_channel(dialog_id)) {
|
||||
auto participant_count = td_->contacts_manager_->get_channel_participant_count(channel_id);
|
||||
if (participant_count < 195) { // include unknown participant_count
|
||||
auto has_hidden_participants =
|
||||
td_->contacts_manager_->get_channel_has_hidden_participants(dialog_id.get_channel_id());
|
||||
if (participant_count < 195 && !has_hidden_participants) { // include unknown participant_count
|
||||
td_->contacts_manager_->get_channel_participants(
|
||||
channel_id, td_api::make_object<td_api::supergroupMembersFilterRecent>(), string(), 0, 200, 200, Auto());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user