Ensure that chat ID is valid in search_dialog_messages.

This commit is contained in:
levlam 2021-12-08 21:29:46 +03:00
parent 6411606fe6
commit 6eb6c12d37

View File

@ -21603,7 +21603,6 @@ std::pair<int32, vector<MessageId>> MessagesManager::search_dialog_messages(
<< " and with limit " << limit; << " and with limit " << limit;
switch (dialog_id.get_type()) { switch (dialog_id.get_type()) {
case DialogType::None:
case DialogType::User: case DialogType::User:
case DialogType::Chat: case DialogType::Chat:
case DialogType::Channel: case DialogType::Channel:
@ -21618,6 +21617,7 @@ std::pair<int32, vector<MessageId>> MessagesManager::search_dialog_messages(
promise.set_error(Status::Error(500, "Search messages in secret chats is not supported")); promise.set_error(Status::Error(500, "Search messages in secret chats is not supported"));
} }
break; break;
case DialogType::None:
default: default:
UNREACHABLE(); UNREACHABLE();
promise.set_error(Status::Error(500, "Search messages is not supported")); promise.set_error(Status::Error(500, "Search messages is not supported"));