From dbbd49ac47cf82d135bf0d9f53604a25fdc490f0 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 23 Sep 2024 18:32:10 +0200 Subject: [PATCH] if a file is locked/ provide token during upload will add needed lock token in final move headers for chunk upload Signed-off-by: Matthieu Gallien --- src/libsync/propagateuploadng.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index f778f79ef..a67225d2a 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -328,6 +328,9 @@ void PropagateUploadFileNG::finishUpload() const auto fileSize = _fileToUpload._size; headers[QByteArrayLiteral("OC-Total-Length")] = QByteArray::number(fileSize); + if (_item->_locked == SyncFileItem::LockStatus::LockedItem) { + headers[QByteArrayLiteral("If")] = (QLatin1String("<") + propagator()->account()->davUrl().toString() + _fileToUpload._file + "> (_lockToken.toUtf8() + ">)").toUtf8(); + } const auto job = new MoveJob(propagator()->account(), Utility::concatUrlPath(chunkUploadFolderUrl(), "/.file"), destination, headers, this); _jobs.append(job);