From bc7599925e0e5f3f2ce26d111e57fd3da78b8aa0 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 16 Mar 2018 15:20:01 +0300 Subject: [PATCH] Better Photo suggested names. GitOrigin-RevId: 21ef626dda95163216d26a2eae0dec8729d11365 --- td/telegram/Photo.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/td/telegram/Photo.cpp b/td/telegram/Photo.cpp index 51f0a8b4c..f08007a87 100644 --- a/td/telegram/Photo.cpp +++ b/td/telegram/Photo.cpp @@ -91,12 +91,7 @@ static FileId register_photo(FileManager *file_manager, FileType file_type, int6 LOG(DEBUG) << "Receive photo of type " << static_cast(file_type) << " in [" << dc_id << "," << volume_id << "," << local_id << "]. Id: (" << id << ", " << access_hash << ")"; - auto suggested_name = [&] { - if (id) { - return PSTRING() << static_cast(id) << ".jpg"; - } - return PSTRING() << static_cast(volume_id) << "_" << static_cast(local_id) << ".jpg"; - }(); + auto suggested_name = PSTRING() << static_cast(volume_id) << "_" << static_cast(local_id) << ".jpg"; return file_manager->register_remote( FullRemoteFileLocation(file_type, id, access_hash, local_id, volume_id, secret, dc_id), FileLocationSource::FromServer, owner_dialog_id, file_size, 0, std::move(suggested_name));