| 1104 | } |
| 1105 | |
| 1106 | void 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 | |
| 1126 | ChatRestriction DocumentData::requiredSendRight() const { |
| 1127 | return isVideoFile() |
no test coverage detected