From b45da619a47ee81c2e3b9f86f9b607bc5440223d Mon Sep 17 00:00:00 2001 From: alex-z Date: Thu, 7 Sep 2023 17:43:43 +0200 Subject: [PATCH] Store the new etag into local database when opening with auto-locking/manual locking the file locally. Signed-off-by: alex-z --- src/libsync/lockfilejobs.cpp | 5 +++++ src/libsync/lockfilejobs.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libsync/lockfilejobs.cpp b/src/libsync/lockfilejobs.cpp index 77f01c3ba034b..47704513938fe 100644 --- a/src/libsync/lockfilejobs.cpp +++ b/src/libsync/lockfilejobs.cpp @@ -104,6 +104,9 @@ void LockFileJob::setFileRecordLocked(SyncJournalFileRecord &record) const record._lockstate._lockEditorApp = _editorName; record._lockstate._lockTime = _lockTime; record._lockstate._lockTimeout = _lockTimeout; + if (!_etag.isEmpty()) { + record._etag = _etag; + } } void LockFileJob::resetState() @@ -223,6 +226,8 @@ void LockFileJob::decodeStartElement(const QString &name, } } else if (name == QStringLiteral("lock-owner-editor")) { _editorName = reader.readElementText(); + } else if (name == QStringLiteral("getetag")) { + _etag = reader.readElementText().toUtf8(); } } diff --git a/src/libsync/lockfilejobs.h b/src/libsync/lockfilejobs.h index be3c436b5ec13..50e02016b7d20 100644 --- a/src/libsync/lockfilejobs.h +++ b/src/libsync/lockfilejobs.h @@ -54,6 +54,7 @@ class OWNCLOUDSYNC_EXPORT LockFileJob : public AbstractNetworkJob QString _userDisplayName; QString _editorName; QString _userId; + QByteArray _etag; qint64 _lockTime = 0; qint64 _lockTimeout = 0; QString _remoteSyncPathWithTrailingSlash;