diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 09f0dae2d..00732bab0 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -887,6 +887,11 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo( qCInfo(lcDisco) << "Not a move, no item in db with inode" << localEntry.inode; return false; } + + if (base._isE2eEncrypted || isInsideEncryptedTree()) { + return false; + } + if (base.isDirectory() != item->isDirectory()) { qCInfo(lcDisco) << "Not a move, types don't match" << base._type << item->_type << localEntry.type; return false; @@ -1149,6 +1154,7 @@ void ProcessDirectoryJob::processFileFinalize( } if (recurse) { auto job = new ProcessDirectoryJob(path, item, recurseQueryLocal, recurseQueryServer, this); + job->setInsideEncryptedTree(isInsideEncryptedTree() || item->_isEncrypted); if (removed) { job->setParent(_discoveryData); _discoveryData->_queuedDeletedDirectories[path._original] = job; diff --git a/src/libsync/discovery.h b/src/libsync/discovery.h index 2d036b9a9..18e43176a 100644 --- a/src/libsync/discovery.h +++ b/src/libsync/discovery.h @@ -88,6 +88,16 @@ public: /** Start up to nbJobs, return the number of job started; emit finished() when done */ int processSubJobs(int nbJobs); + void setInsideEncryptedTree(bool isInsideEncryptedTree) + { + _isInsideEncryptedTree = isInsideEncryptedTree; + } + + bool isInsideEncryptedTree() const + { + return _isInsideEncryptedTree; + } + SyncFileItemPtr _dirItem; private: @@ -273,6 +283,7 @@ private: bool _childModified = false; // the directory contains modified item what would prevent deletion bool _childIgnored = false; // The directory contains ignored item that would prevent deletion PinState _pinState = PinState::Unspecified; // The directory's pin-state, see computePinState() + bool _isInsideEncryptedTree = false; // this directory is encrypted or is within the tree of directories with root directory encrypted signals: void finished();