From 48fefcd59b2b814b187d394ae5f8148884868ffb Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 1 Aug 2024 16:22:23 +0800 Subject: [PATCH 1/2] Check lock ownership based on remote interface username --- Sources/NextcloudFileProviderKit/Item/Item.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/NextcloudFileProviderKit/Item/Item.swift b/Sources/NextcloudFileProviderKit/Item/Item.swift index 9e28710..93d68a5 100644 --- a/Sources/NextcloudFileProviderKit/Item/Item.swift +++ b/Sources/NextcloudFileProviderKit/Item/Item.swift @@ -153,7 +153,7 @@ public class Item: NSObject, NSFileProviderItem { public var fileSystemFlags: NSFileProviderFileSystemFlags { if metadata.lock, - metadata.lockOwner != metadata.userId, + metadata.lockOwner != remoteInterface.account.username, metadata.lockTimeOut ?? Date() > Date() { return [.userReadable] From 8b15f7e6bab479fe217aa3e3307536d83b13e873 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 1 Aug 2024 18:23:27 +0800 Subject: [PATCH 2/2] Do not lock if the lock type is that of a user --- Sources/NextcloudFileProviderKit/Item/Item.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/NextcloudFileProviderKit/Item/Item.swift b/Sources/NextcloudFileProviderKit/Item/Item.swift index 93d68a5..57de285 100644 --- a/Sources/NextcloudFileProviderKit/Item/Item.swift +++ b/Sources/NextcloudFileProviderKit/Item/Item.swift @@ -153,7 +153,7 @@ public class Item: NSObject, NSFileProviderItem { public var fileSystemFlags: NSFileProviderFileSystemFlags { if metadata.lock, - metadata.lockOwner != remoteInterface.account.username, + (metadata.lockOwnerType != 0 || metadata.lockOwner != remoteInterface.account.username), metadata.lockTimeOut ?? Date() > Date() { return [.userReadable]