From c95598e5e1493881d31211c1329bdbe4630f6136 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 27 Mar 2023 12:05:32 +0300 Subject: [PATCH] Don't register users and channels for bots. --- td/telegram/ContactsManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 207b1f4a0..254a21522 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -9446,6 +9446,9 @@ void ContactsManager::remove_inactive_channel(ChannelId channel_id) { } void ContactsManager::register_message_users(FullMessageId full_message_id, vector user_ids) { + if (td_->auth_manager_->is_bot()) { + return; + } for (auto user_id : user_ids) { CHECK(user_id.is_valid()); const User *u = get_user(user_id); @@ -9461,6 +9464,9 @@ void ContactsManager::register_message_users(FullMessageId full_message_id, vect } void ContactsManager::register_message_channels(FullMessageId full_message_id, vector channel_ids) { + if (td_->auth_manager_->is_bot()) { + return; + } for (auto channel_id : channel_ids) { CHECK(channel_id.is_valid()); const Channel *c = get_channel(channel_id);