From: Matthieu Gallien Date: Mon, 23 Sep 2024 16:32:10 +0000 (+0200) Subject: if a file is locked/ provide token during upload X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~171^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=afaaf308aa91e1a1897c58785b946dddc63fd958;p=nextcloud-desktop.git 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 --- 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);