aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/CommunityManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'td/telegram/CommunityManager.cpp')
-rw-r--r--td/telegram/CommunityManager.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/td/telegram/CommunityManager.cpp b/td/telegram/CommunityManager.cpp
index c28e997ed..ba601b9a1 100644
--- a/td/telegram/CommunityManager.cpp
+++ b/td/telegram/CommunityManager.cpp
@@ -599,4 +599,16 @@ td_api::object_ptr<td_api::updateCommunity> CommunityManager::get_update_unknown
td_api::make_object<td_api::community>(community_id.get(), false, string(), nullptr, 0));
}
+void CommunityManager::get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const {
+ for (auto community_id : unknown_communities_) {
+ if (!have_community(community_id)) {
+ updates.push_back(get_update_unknown_community_object(community_id));
+ }
+ }
+
+ communities_.foreach([&](const CommunityId &community_id, const unique_ptr<Community> &community) {
+ updates.push_back(get_update_community_object(community_id, community.get()));
+ });
+}
+
} // namespace td