|
@@ -521,6 +521,15 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // We need to make sure that we update the info in the database if the lockstate has changed
|
|
|
|
|
+ const auto checkFileLockState = [&item, &dbEntry, &serverEntry] {
|
|
|
|
|
+ const bool isServerEntryLocked = serverEntry.locked == SyncFileItem::LockStatus::LockedItem;
|
|
|
|
|
+
|
|
|
|
|
+ if(isServerEntryLocked != dbEntry._lockstate._locked) {
|
|
|
|
|
+ item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// The file is known in the db already
|
|
// The file is known in the db already
|
|
|
if (dbEntry.isValid()) {
|
|
if (dbEntry.isValid()) {
|
|
|
const bool isDbEntryAnE2EePlaceholder = dbEntry.isVirtualFile() && !dbEntry.e2eMangledName().isEmpty();
|
|
const bool isDbEntryAnE2EePlaceholder = dbEntry.isVirtualFile() && !dbEntry.e2eMangledName().isEmpty();
|
|
@@ -528,7 +537,6 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
|
|
|
const bool isVirtualE2EePlaceholder = isDbEntryAnE2EePlaceholder && serverEntry.size >= Constants::e2EeTagSize;
|
|
const bool isVirtualE2EePlaceholder = isDbEntryAnE2EePlaceholder && serverEntry.size >= Constants::e2EeTagSize;
|
|
|
const qint64 sizeOnServer = isVirtualE2EePlaceholder ? serverEntry.size - Constants::e2EeTagSize : serverEntry.size;
|
|
const qint64 sizeOnServer = isVirtualE2EePlaceholder ? serverEntry.size - Constants::e2EeTagSize : serverEntry.size;
|
|
|
const bool metaDataSizeNeedsUpdateForE2EeFilePlaceholder = isVirtualE2EePlaceholder && dbEntry._fileSize == serverEntry.size;
|
|
const bool metaDataSizeNeedsUpdateForE2EeFilePlaceholder = isVirtualE2EePlaceholder && dbEntry._fileSize == serverEntry.size;
|
|
|
- const bool isServerEntryLocked = serverEntry.locked == SyncFileItem::LockStatus::LockedItem;
|
|
|
|
|
|
|
|
|
|
if (serverEntry.isDirectory != dbEntry.isDirectory()) {
|
|
if (serverEntry.isDirectory != dbEntry.isDirectory()) {
|
|
|
// If the type of the entity changed, it's like NEW, but
|
|
// If the type of the entity changed, it's like NEW, but
|
|
@@ -575,8 +583,6 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
|
|
|
}
|
|
}
|
|
|
item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
|
item->_direction = SyncFileItem::Down;
|
|
item->_direction = SyncFileItem::Down;
|
|
|
- } else if(isServerEntryLocked != dbEntry._lockstate._locked) {
|
|
|
|
|
- item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
|
|
|
} else {
|
|
} else {
|
|
|
// if (is virtual mode enabled and folder is encrypted - check if the size is the same as on the server and then - trigger server query
|
|
// if (is virtual mode enabled and folder is encrypted - check if the size is the same as on the server and then - trigger server query
|
|
|
// to update a placeholder with corrected size (-16 Bytes)
|
|
// to update a placeholder with corrected size (-16 Bytes)
|
|
@@ -605,10 +611,12 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
|
|
|
return ParentNotChanged;
|
|
return ParentNotChanged;
|
|
|
}();
|
|
}();
|
|
|
|
|
|
|
|
|
|
+ checkFileLockState();
|
|
|
processFileAnalyzeLocalInfo(item, path, localEntry, serverEntry, dbEntry, serverQueryMode);
|
|
processFileAnalyzeLocalInfo(item, path, localEntry, serverEntry, dbEntry, serverQueryMode);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ checkFileLockState();
|
|
|
processFileAnalyzeLocalInfo(item, path, localEntry, serverEntry, dbEntry, _queryServer);
|
|
processFileAnalyzeLocalInfo(item, path, localEntry, serverEntry, dbEntry, _queryServer);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|