Skip to content

Commit

Permalink
Ignore the unsupported chat among returned chats.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Sep 16, 2023
1 parent bad52cd commit daf4801
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions td/telegram/ContactsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 2 additions & 0 deletions td/telegram/ContactsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions td/telegram/UpdatesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit daf4801

Please sign in to comment.