MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / readFileLocation

Method readFileLocation

Telegram/SourceFiles/storage/storage_account.cpp:1807–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1805}
1806
1807Core::FileLocation Account::readFileLocation(MediaKey location) {
1808 const auto aliasIt = _fileLocationAliases.constFind(location);
1809 if (aliasIt != _fileLocationAliases.cend()) {
1810 location = aliasIt.value();
1811 }
1812
1813 for (auto i = _fileLocations.find(location); (i != _fileLocations.end()) && (i.key() == location);) {
1814 if (!i.value().inMediaCache() && !i.value().check()) {
1815 _fileLocationPairs.remove(i.value().fname);
1816 i = _fileLocations.erase(i);
1817 writeLocationsDelayed();
1818 continue;
1819 }
1820 return i.value();
1821 }
1822 return Core::FileLocation();
1823}
1824
1825EncryptionKey Account::cacheKey() const {
1826 Expects(_localKey != nullptr);

Callers 3

data_document.cppFile · 0.80
setRemoteLocationMethod · 0.80
data_photo.cppFile · 0.80

Calls 10

inMediaCacheMethod · 0.80
FileLocationClass · 0.70
cendMethod · 0.45
valueMethod · 0.45
findMethod · 0.45
endMethod · 0.45
keyMethod · 0.45
checkMethod · 0.45
removeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected