Skip to content

Commit

Permalink
Merge pull request #6038 from nextcloud/feature/lock-file-store-etag
Browse files Browse the repository at this point in the history
Store the new etag into local database when opening with auto-locking…
  • Loading branch information
allexzander authored Sep 8, 2023
2 parents b3f9ff2 + c6978be commit a8b4867
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libsync/lockfilejobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/libsync/lockfilejobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a8b4867

Please sign in to comment.