diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 71c3e76320aa..2ef1b65f7dfd 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -6276,6 +6276,10 @@ UserId ContactsManager::add_channel_bot_user() { return user_id; } +ChatId ContactsManager::get_unsupported_chat_id() { + return ChatId(static_cast(G()->is_test_dc() ? 10304875 : 1535424647)); +} + void ContactsManager::check_dialog_username(DialogId dialog_id, const string &username, Promise &&promise) { if (dialog_id != DialogId() && !dialog_id.is_valid()) { diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index adc724a673c4..9b1b2115e6b3 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -311,6 +311,8 @@ class ContactsManager final : public Actor { UserId add_channel_bot_user(); + static ChatId get_unsupported_chat_id(); + void on_update_username_is_active(UserId user_id, string &&username, bool is_active, Promise &&promise); void on_update_active_usernames_order(UserId user_id, vector &&usernames, Promise &&promise); diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index a71268f21412..d69ad1813b3a 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1613,6 +1613,9 @@ vector UpdatesManager::get_chat_dialog_ids(const telegram_api::Updates LOG(ERROR) << "Can't find identifier of " << oneline(to_string(chat)); } } + if (dialog_ids.size() > 1) { + td::remove(dialog_ids, DialogId(ContactsManager::get_unsupported_chat_id())); + } return dialog_ids; }