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

Method collectLocalData

Telegram/SourceFiles/data/data_document.cpp:1964–1979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1962}
1963
1964void DocumentData::collectLocalData(not_null<DocumentData*> local) {
1965 if (local == this) {
1966 return;
1967 }
1968
1969 _owner->cache().copyIfEmpty(local->cacheKey(), cacheKey());
1970 if (const auto localMedia = local->activeMediaView()) {
1971 auto media = createMediaView();
1972 media->collectLocalData(localMedia.get());
1973 _owner->keepAlive(std::move(media));
1974 }
1975 if (!local->_location.inMediaCache() && !local->_location.isEmpty()) {
1976 _location = local->_location;
1977 session().local().writeFileLocation(mediaKey(), _location);
1978 }
1979}
1980
1981PhotoData *LookupVideoCover(
1982 not_null<DocumentData*> document,

Callers

nothing calls this directly

Calls 8

mediaKeyFunction · 0.85
inMediaCacheMethod · 0.80
writeFileLocationMethod · 0.80
cacheKeyMethod · 0.45
activeMediaViewMethod · 0.45
getMethod · 0.45
keepAliveMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected