aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/Dependencies.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'td/telegram/Dependencies.cpp')
-rw-r--r--td/telegram/Dependencies.cpp15
1 files changed, 15 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;