From b9d1b80f6a373443be2ebb8c8ec96fa1cf1af663 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 16 Jan 2020 05:09:25 +0300 Subject: [PATCH] Do not remove file reference from remote.id. GitOrigin-RevId: 3c934cec452f4ca4147aa81711fcd0ac1fee964a --- td/telegram/files/FileLocation.h | 4 ---- td/telegram/files/FileManager.cpp | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/td/telegram/files/FileLocation.h b/td/telegram/files/FileLocation.h index 69f725ce4..c0d3355cd 100644 --- a/td/telegram/files/FileLocation.h +++ b/td/telegram/files/FileLocation.h @@ -331,10 +331,6 @@ class FullRemoteFileLocation { } } - void clear_file_reference() { - file_reference_.clear(); - } - bool delete_file_reference(Slice bad_file_reference) { if (file_reference_ != FileReferenceView::invalid_file_reference() && file_reference_ == bad_file_reference) { file_reference_ = FileReferenceView::invalid_file_reference().str(); diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 8fa627dd6..c8fb0e1e6 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -2726,9 +2726,7 @@ string FileManager::get_persistent_id(const FullGenerateFileLocation &location) } string FileManager::get_persistent_id(const FullRemoteFileLocation &location) { - auto location_copy = location; - location_copy.clear_file_reference(); - auto binary = serialize(location_copy); + auto binary = serialize(location); binary = zero_encode(binary); binary.push_back(static_cast(narrow_cast(Version::Next) - 1));