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

Method setLoadedInMediaCache

Telegram/SourceFiles/data/data_document.cpp:1106–1124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1104}
1105
1106void DocumentData::setLoadedInMediaCache(bool loaded) {
1107 const auto flags = loaded
1108 ? (_flags | Flag::LoadedInMediaCache)
1109 : (_flags & ~Flag::LoadedInMediaCache);
1110 if (_flags == flags) {
1111 return;
1112 }
1113 _flags = flags;
1114 if (filepath().isEmpty()) {
1115 if (loadedInMediaCache()) {
1116 session().local().writeFileLocation(
1117 mediaKey(),
1118 Core::FileLocation::InMediaCacheLocation());
1119 } else {
1120 session().local().removeFileLocation(mediaKey());
1121 }
1122 owner().requestDocumentViewRepaint(this);
1123 }
1124}
1125
1126ChatRestriction DocumentData::requiredSendRight() const {
1127 return isVideoFile()

Callers 1

DocumentMethod · 0.80

Calls 5

mediaKeyFunction · 0.85
writeFileLocationMethod · 0.80
removeFileLocationMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected