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

Method collectLocalData

Telegram/SourceFiles/data/data_photo.cpp:297–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void PhotoData::collectLocalData(not_null<PhotoData*> local) {
298 if (local == this) {
299 return;
300 }
301
302 for (auto i = 0; i != kPhotoSizeCount; ++i) {
303 if (const auto from = local->_images[i].location.file().cacheKey()) {
304 if (const auto to = _images[i].location.file().cacheKey()) {
305 _owner->cache().copyIfEmpty(from, to);
306 }
307 }
308 }
309 if (const auto localMedia = local->activeMediaView()) {
310 auto media = createMediaView();
311 media->collectLocalData(localMedia.get());
312 _owner->keepAlive(std::move(media));
313 }
314}
315
316bool PhotoData::isNull() const {
317 return !_images[PhotoSizeIndex(PhotoSize::Large)].location.valid();

Callers 1

Calls 4

cacheKeyMethod · 0.45
activeMediaViewMethod · 0.45
getMethod · 0.45
keepAliveMethod · 0.45

Tested by

no test coverage detected