From 3268cbdd8a48bdca62076d55be807d6ba89bc142 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 16 Mar 2019 23:25:11 +0300 Subject: [PATCH] Prefer URL or generate location over local location when storing a file, because local location could be invalidated any time soon. GitOrigin-RevId: 1782db65a8fc5cfd90f51f755be56b9b6f8d513f --- td/telegram/files/FileManager.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/td/telegram/files/FileManager.hpp b/td/telegram/files/FileManager.hpp index 3b4f2de63..9d7ca515a 100644 --- a/td/telegram/files/FileManager.hpp +++ b/td/telegram/files/FileManager.hpp @@ -30,12 +30,12 @@ void FileManager::store_file(FileId file_id, StorerT &storer, int32 ttl) const { if (file_view.empty() || ttl <= 0) { } else if (file_view.has_remote_location()) { file_store_type = FileStoreType::Remote; - } else if (file_view.has_local_location()) { - file_store_type = FileStoreType::Local; } else if (file_view.has_url()) { file_store_type = FileStoreType::Url; } else if (file_view.has_generate_location()) { file_store_type = FileStoreType::Generate; + } else if (file_view.has_local_location()) { + file_store_type = FileStoreType::Local; } store(file_store_type, storer); @@ -173,7 +173,8 @@ FileId FileManager::parse_file(ParserT &parser) { if (r_file_id.is_ok()) { return r_file_id.move_as_ok(); } - LOG(ERROR) << "Can't resend local file " << full_local_location.path_; + LOG(ERROR) << "Can't resend local file " << full_local_location << " of size " << size << " owned by " + << owner_dialog_id; return register_empty(full_local_location.file_type_); } case FileStoreType::Generate: {