aboutsummaryrefslogtreecommitdiffhomepage
path: root/td
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2026-07-10 16:11:11 +0300
committerlevlam <levlam@telegram.org>2026-07-10 16:11:11 +0300
commitec1b948090520d1b8ac377c22a1545ddc674b179 (patch)
treecc214313b4e68a46ac46b121fea7cded7c61d31f /td
parente4e806bbeca07f08fed9269d4e31c5607619b597 (diff)
Support communities in dependencies.
Diffstat (limited to 'td')
-rw-r--r--td/telegram/Dependencies.cpp15
-rw-r--r--td/telegram/Dependencies.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/td/telegram/Dependencies.cpp b/td/telegram/Dependencies.cpp
index 9d0a42dee..df740e1e8 100644
--- a/td/telegram/Dependencies.cpp
+++ b/td/telegram/Dependencies.cpp
@@ -7,6 +7,7 @@
#include "td/telegram/Dependencies.h"
#include "td/telegram/ChatManager.h"
+#include "td/telegram/CommunityManager.h"
#include "td/telegram/DialogManager.h"
#include "td/telegram/StoryManager.h"
#include "td/telegram/Td.h"
@@ -42,6 +43,12 @@ void Dependencies::add(SecretChatId secret_chat_id) {
}
}
+void Dependencies::add(CommunityId community_id) {
+ if (community_id.is_valid()) {
+ community_ids.insert(community_id);
+ }
+}
+
void Dependencies::add(WebPageId web_page_id) {
if (web_page_id.is_valid()) {
web_page_ids.insert(web_page_id);
@@ -137,6 +144,14 @@ bool Dependencies::resolve_force(Td *td, const char *source, bool ignore_errors)
success = false;
}
}
+ for (auto community_id : community_ids) {
+ if (!td->community_manager_->have_community_force(community_id, source)) {
+ if (!ignore_errors) {
+ LOG(ERROR) << "Can't find " << community_id << " from " << source;
+ }
+ success = false;
+ }
+ }
for (auto web_page_id : web_page_ids) {
if (!td->web_pages_manager_->have_web_page_force(web_page_id)) {
LOG(INFO) << "Can't find " << web_page_id << " from " << source;
diff --git a/td/telegram/Dependencies.h b/td/telegram/Dependencies.h
index e02ba2aa6..301915b91 100644
--- a/td/telegram/Dependencies.h
+++ b/td/telegram/Dependencies.h
@@ -8,6 +8,7 @@
#include "td/telegram/ChannelId.h"
#include "td/telegram/ChatId.h"
+#include "td/telegram/CommunityId.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/SecretChatId.h"
#include "td/telegram/StoryFullId.h"
@@ -26,6 +27,7 @@ class Dependencies {
FlatHashSet<ChannelId, ChannelIdHash> channel_ids;
FlatHashSet<SecretChatId, SecretChatIdHash> secret_chat_ids;
FlatHashSet<DialogId, DialogIdHash> dialog_ids;
+ FlatHashSet<CommunityId, CommunityIdHash> community_ids;
FlatHashSet<WebPageId, WebPageIdHash> web_page_ids;
FlatHashSet<StoryFullId, StoryFullIdHash> story_full_ids;
@@ -38,6 +40,8 @@ class Dependencies {
void add(SecretChatId secret_chat_id);
+ void add(CommunityId community_id);
+
void add(WebPageId web_page_id);
void add(StoryFullId story_full_id);