diff options
| author | levlam <levlam@telegram.org> | 2026-07-09 23:47:40 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-07-09 23:47:40 +0300 |
| commit | a83a851fe42c393cd34ffd8fcb9ef9ebe3e7db0c (patch) | |
| tree | 6c667599cf872b1f29b2ea7c3c6f13dfabfefab4 /td/telegram/CommunityManager.cpp | |
| parent | c0983b4c1dd7c01abd6553dd114b2d940beab070 (diff) | |
Support updateCommunity in getCurrentState.
Diffstat (limited to 'td/telegram/CommunityManager.cpp')
| -rw-r--r-- | td/telegram/CommunityManager.cpp | 12 |
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 |
