diff options
| author | levlam <levlam@telegram.org> | 2026-07-10 16:49:13 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-07-10 16:49:13 +0300 |
| commit | 691feaf49b0a8cb83c8f4b4768f93ca9c1b5df30 (patch) | |
| tree | a77f5fe3d2d5cd0cb1d40f5c8a69f2f6e8948082 /td/telegram/CommunityManager.cpp | |
| parent | 1add3c9bfb4bd19e4fb2986bb03e52ba93f21c14 (diff) | |
Add and use CommunityManager::get_community_id_object.
Diffstat (limited to 'td/telegram/CommunityManager.cpp')
| -rw-r--r-- | td/telegram/CommunityManager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/td/telegram/CommunityManager.cpp b/td/telegram/CommunityManager.cpp index 1896301d0..734ce999d 100644 --- a/td/telegram/CommunityManager.cpp +++ b/td/telegram/CommunityManager.cpp @@ -621,6 +621,16 @@ void CommunityManager::on_update_community_default_permissions(Community *c, Com } } +int64 CommunityManager::get_community_id_object(CommunityId community_id, const char *source) const { + if (community_id.is_valid() && get_community(community_id) == nullptr && + unknown_communities_.count(community_id) == 0) { + LOG(ERROR) << "Have no information about " << community_id << " received from " << source; + unknown_communities_.insert(community_id); + send_closure(G()->td(), &Td::send_update, get_update_unknown_community_object(community_id)); + } + return community_id.get(); +} + td_api::object_ptr<td_api::community> CommunityManager::get_community_object(CommunityId community_id) const { return get_community_object(community_id, get_community(community_id)); } |
