Merge pull request #5371 from nextcloud/bugfix/do-not-lock-if-lock-is-not-available

Edit locally. Do not lock if locking is disabled on the server.
This commit is contained in:
allexzander 2023-01-26 18:35:51 +01:00 committed by GitHub
commit e332929ffe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -565,7 +565,8 @@ void EditLocallyJob::processLocalItem()
const auto ok = _folderForFile->journalDb()->getFileRecord(_relativePathToRemoteRoot, &rec);
Q_ASSERT(ok);
if (rec.isDirectory()) { // Directories not lock-able
// Do not lock if it is a directory or lock is not available on the server
if (rec.isDirectory() || !_accountState->account()->capabilities().filesLockAvailable()) {
openFile();
} else {
lockFile();