FileMananger: do not store file reference is persistent file id

GitOrigin-RevId: 6da317bcac575ed4398a8971229250c0948ee097
This commit is contained in:
Arseny Smirnov 2019-02-27 18:08:24 +03:00
parent bbf67ad700
commit 66c604f2d4
2 changed files with 6 additions and 1 deletions

View File

@ -393,6 +393,9 @@ class FullRemoteFileLocation {
return 0;
}
}
void clear_file_reference() {
file_reference_ = "";
}
bool delete_file_reference(Slice bad_file_reference) {
auto res = FileReferenceView(file_reference_).delete_file_reference(bad_file_reference);

View File

@ -2435,7 +2435,9 @@ string FileManager::get_persistent_id(const FullGenerateFileLocation &location)
return base64url_encode(binary);
}
string FileManager::get_persistent_id(const FullRemoteFileLocation &location) {
auto binary = serialize(location);
auto location_copy = location;
location_copy.clear_file_reference();
auto binary = serialize(location_copy);
binary = zero_encode(binary);
binary.push_back(PERSISTENT_ID_VERSION);