Recheck received from the server channels.

This commit is contained in:
levlam 2023-09-20 20:34:21 +03:00
parent 036f37fe43
commit 246f2ca42f
2 changed files with 8 additions and 2 deletions

View File

@ -9409,10 +9409,13 @@ void ContactsManager::on_get_created_public_channels(PublicDialogType type,
if (created_public_channels_inited_[index] && created_public_channels_[index] == channel_ids) {
return;
}
created_public_channels_[index].clear();
for (auto channel_id : channel_ids) {
td_->messages_manager_->force_create_dialog(DialogId(channel_id), "on_get_created_public_channels");
if (is_suitable_created_public_channel(type, get_channel(channel_id))) {
created_public_channels_[index].push_back(channel_id);
}
}
created_public_channels_[index] = std::move(channel_ids);
created_public_channels_inited_[index] = true;
if (type == PublicDialogType::HasUsername) {

View File

@ -4682,10 +4682,13 @@ void StoryManager::on_get_dialogs_to_send_stories(vector<tl_object_ptr<telegram_
if (channels_to_send_stories_inited_ && channels_to_send_stories_ == channel_ids) {
return;
}
channels_to_send_stories_.clear();
for (auto channel_id : channel_ids) {
td_->messages_manager_->force_create_dialog(DialogId(channel_id), "on_get_dialogs_to_send_stories");
if (td_->contacts_manager_->get_channel_status(channel_id).can_post_stories()) {
channels_to_send_stories_.push_back(channel_id);
}
}
channels_to_send_stories_ = std::move(channel_ids);
channels_to_send_stories_inited_ = true;
save_channels_to_send_stories();