aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--td/telegram/CommunityManager.cpp10
-rw-r--r--td/telegram/CommunityManager.h2
-rw-r--r--td/telegram/UserManager.cpp17
3 files changed, 21 insertions, 8 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));
}
diff --git a/td/telegram/CommunityManager.h b/td/telegram/CommunityManager.h
index fb936d601..c2d3a621b 100644
--- a/td/telegram/CommunityManager.h
+++ b/td/telegram/CommunityManager.h
@@ -43,6 +43,8 @@ class CommunityManager final : public Actor {
void on_get_community_forbidden(telegram_api::communityForbidden &community, const char *source);
+ int64 get_community_id_object(CommunityId community_id, const char *source) const;
+
td_api::object_ptr<td_api::community> get_community_object(CommunityId community_id) const;
telegram_api::object_ptr<telegram_api::InputChannel> get_input_community(CommunityId community_id) const;
diff --git a/td/telegram/UserManager.cpp b/td/telegram/UserManager.cpp
index 29dff4cc7..3eb3e627e 100644
--- a/td/telegram/UserManager.cpp
+++ b/td/telegram/UserManager.cpp
@@ -10417,14 +10417,15 @@ td_api::object_ptr<td_api::userFullInfo> UserManager::get_user_full_info_object(
get_chat_photo_object(td_->file_manager_.get(), user_full->personal_photo),
get_chat_photo_object(td_->file_manager_.get(), user_full->photo),
get_chat_photo_object(td_->file_manager_.get(), user_full->fallback_photo),
- is_bot ? u->linked_community_id.get() : 0, block_list_id.get_block_list_object(), user_full->can_be_called,
- user_full->supports_video_calls, user_full->has_private_calls, !user_full->private_forward_name.empty(),
- voice_messages_forbidden, user_full->has_pinned_stories, user_full->sponsored_enabled,
- user_full->need_phone_number_privacy_exception, user_full->wallpaper_overridden,
- user_full->unofficial_security_risk, std::move(bio_object), user_full->birthdate.get_birthdate_object(),
- personal_chat_id, user_full->gift_count, user_full->common_chat_count, user_full->charge_paid_message_stars,
- user_full->send_paid_message_stars, user_full->gift_settings.get_gift_settings_object(),
- std::move(bot_verification), get_profile_tab_object(user_full->main_profile_tab),
+ is_bot ? td_->community_manager_->get_community_id_object(u->linked_community_id, "userFullInfo") : 0,
+ block_list_id.get_block_list_object(), user_full->can_be_called, user_full->supports_video_calls,
+ user_full->has_private_calls, !user_full->private_forward_name.empty(), voice_messages_forbidden,
+ user_full->has_pinned_stories, user_full->sponsored_enabled, user_full->need_phone_number_privacy_exception,
+ user_full->wallpaper_overridden, user_full->unofficial_security_risk, std::move(bio_object),
+ user_full->birthdate.get_birthdate_object(), personal_chat_id, user_full->gift_count,
+ user_full->common_chat_count, user_full->charge_paid_message_stars, user_full->send_paid_message_stars,
+ user_full->gift_settings.get_gift_settings_object(), std::move(bot_verification),
+ get_profile_tab_object(user_full->main_profile_tab),
td_->audios_manager_->get_audio_object(user_full->first_saved_music_file_id), std::move(user_rating),
std::move(pending_user_rating), user_full->pending_star_rating_date, std::move(note), std::move(business_info),
std::move(bot_info));