Merge pull request #6038 from nextcloud/feature/lock-file-store-etag

Store the new etag into local database when opening with auto-locking…
This commit is contained in:
allexzander 2023-09-08 10:52:14 +02:00 committed by GitHub
commit a8b4867b87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -104,6 +104,9 @@ void LockFileJob::setFileRecordLocked(SyncJournalFileRecord &record) const
record._lockstate._lockEditorApp = _editorName; record._lockstate._lockEditorApp = _editorName;
record._lockstate._lockTime = _lockTime; record._lockstate._lockTime = _lockTime;
record._lockstate._lockTimeout = _lockTimeout; record._lockstate._lockTimeout = _lockTimeout;
if (!_etag.isEmpty()) {
record._etag = _etag;
}
} }
void LockFileJob::resetState() void LockFileJob::resetState()
@ -223,6 +226,8 @@ void LockFileJob::decodeStartElement(const QString &name,
} }
} else if (name == QStringLiteral("lock-owner-editor")) { } else if (name == QStringLiteral("lock-owner-editor")) {
_editorName = reader.readElementText(); _editorName = reader.readElementText();
} else if (name == QStringLiteral("getetag")) {
_etag = reader.readElementText().toUtf8();
} }
} }

View file

@ -54,6 +54,7 @@ private:
QString _userDisplayName; QString _userDisplayName;
QString _editorName; QString _editorName;
QString _userId; QString _userId;
QByteArray _etag;
qint64 _lockTime = 0; qint64 _lockTime = 0;
qint64 _lockTimeout = 0; qint64 _lockTimeout = 0;
QString _remoteSyncPathWithTrailingSlash; QString _remoteSyncPathWithTrailingSlash;