diff --git a/td/telegram/DownloadManager.cpp b/td/telegram/DownloadManager.cpp index 4adef5b6e..8ba489e2a 100644 --- a/td/telegram/DownloadManager.cpp +++ b/td/telegram/DownloadManager.cpp @@ -134,14 +134,6 @@ class DownloadManagerImpl final : public DownloadManager { return remove_file(file_id, {}, false); } - Status change_search_text(FileId file_id, FileSourceId file_source_id, string search_text) final { - TRY_STATUS(check_is_active()); - TRY_RESULT(file_info_ptr, get_file_info(file_id, file_source_id)); - auto &file_info = *file_info_ptr; - hints_.add(file_info.download_id, search_text.empty() ? string(" ") : search_text); - return Status::OK(); - } - Status remove_all_files(bool only_active, bool only_completed, bool delete_from_cache) final { TRY_STATUS(check_is_active()); vector to_remove; @@ -182,6 +174,18 @@ class DownloadManagerImpl final : public DownloadManager { return Status::OK(); } + Status change_search_text(FileId file_id, FileSourceId file_source_id, string search_text) final { + if (!is_search_inited_) { + return Status::OK(); + } + + TRY_STATUS(check_is_active()); + TRY_RESULT(file_info_ptr, get_file_info(file_id, file_source_id)); + auto &file_info = *file_info_ptr; + hints_.add(file_info.download_id, search_text.empty() ? string(" ") : search_text); + return Status::OK(); + } + void hints_synchronized(Result) { if (G()->close_flag()) { return;