Do not create dialog in check_dialog_username.

GitOrigin-RevId: 788310ce62dc9d824f00043b7aecf2a512cd7a84
This commit is contained in:
levlam 2018-03-04 22:27:42 +03:00
parent e0381695a3
commit 1a8eb4b4e5

View File

@ -3092,7 +3092,7 @@ void ContactsManager::set_my_online_status(bool is_online, bool send_update) {
void ContactsManager::check_dialog_username(DialogId dialog_id, const string &username,
Promise<CheckDialogUsernameResult> &&promise) {
if (dialog_id != DialogId() && !td_->messages_manager_->have_dialog_force(dialog_id)) {
if (dialog_id != DialogId() && !dialog_id.is_valid()) {
return promise.set_error(Status::Error(3, "Chat not found"));
}