Ignore the unsupported chat among returned chats.

This commit is contained in:
levlam 2023-09-17 01:34:13 +03:00
parent bad52cd8dc
commit daf480138d
3 changed files with 9 additions and 0 deletions

View File

@ -6276,6 +6276,10 @@ UserId ContactsManager::add_channel_bot_user() {
return user_id;
}
ChatId ContactsManager::get_unsupported_chat_id() {
return ChatId(static_cast<int64>(G()->is_test_dc() ? 10304875 : 1535424647));
}
void ContactsManager::check_dialog_username(DialogId dialog_id, const string &username,
Promise<CheckDialogUsernameResult> &&promise) {
if (dialog_id != DialogId() && !dialog_id.is_valid()) {

View File

@ -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<Unit> &&promise);
void on_update_active_usernames_order(UserId user_id, vector<string> &&usernames, Promise<Unit> &&promise);

View File

@ -1613,6 +1613,9 @@ vector<DialogId> 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;
}