Skip to content

Commit

Permalink
Bugfix. Files lock. Check lock owner type for setting readonly based …
Browse files Browse the repository at this point in the history
…on server capabilities (NC27/28 compatibility issue).

Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed May 9, 2024
1 parent cf88802 commit c7591f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
}

if (item->_type == CSyncEnums::ItemTypeVirtualFile) {
if (item->_locked == SyncFileItem::LockStatus::LockedItem && (item->_lockOwnerType != SyncFileItem::LockOwnerType::TokenLock || item->_lockOwnerId != account()->davUser())) {
const auto lockOwnerTypeToSkipReadonly = _account->capabilities().filesLockTypeAvailable()
? SyncFileItem::LockOwnerType::TokenLock
: SyncFileItem::LockOwnerType::UserLock;
if (item->_locked == SyncFileItem::LockStatus::LockedItem
&& (item->_lockOwnerType != lockOwnerTypeToSkipReadonly || item->_lockOwnerId != account()->davUser())) {
qCDebug(lcEngine()) << filePath << "file is locked: making it read only";
FileSystem::setFileReadOnly(filePath, true);
} else {
Expand Down

0 comments on commit c7591f6

Please sign in to comment.