Skip to content

Commit

Permalink
if a file is locked/ provide token during upload
Browse files Browse the repository at this point in the history
will add needed lock token in final move headers for chunk upload

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Sep 25, 2024
1 parent 451faaf commit afaaf30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libsync/propagateuploadng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "> (<opaquelocktoken:" + _item->_lockToken.toUtf8() + ">)").toUtf8();
}

const auto job = new MoveJob(propagator()->account(), Utility::concatUrlPath(chunkUploadFolderUrl(), "/.file"), destination, headers, this);
_jobs.append(job);
Expand Down

0 comments on commit afaaf30

Please sign in to comment.