From 246f2ca42f786b372cf09ac551a5851b2399770a Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 20 Sep 2023 20:34:21 +0300 Subject: [PATCH] Recheck received from the server channels. --- td/telegram/ContactsManager.cpp | 5 ++++- td/telegram/StoryManager.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index fa55b0477..2852cb608 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -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) { diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index b7cace397..150f7d865 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -4682,10 +4682,13 @@ void StoryManager::on_get_dialogs_to_send_stories(vectormessages_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();