Skip to content

Commit

Permalink
Store the new etag into local database when opening with auto-locking…
Browse files Browse the repository at this point in the history
…/manual locking the file locally.

Signed-off-by: alex-z <blackslayer4@gmail.com>
  • Loading branch information
allexzander committed Sep 7, 2023
1 parent b3f9ff2 commit c6978be
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 c6978be

Please sign in to comment.