Skip to content

Commit d6cdbc8

Browse files
i2h3Rello
authored andcommitted
fix: Do not report file provider items as shared.
Interim solution to counteract Finder misleadingly displaying shared items with an iCloud branded banner. Signed-off-by: Iva Horn <iva.horn@icloud.com>
1 parent 7a16f47 commit d6cdbc8

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

Sources/NextcloudFileProviderKit/Item/Item.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ public class Item: NSObject, NSFileProviderItem {
151151
}
152152

153153
public var isShared: Bool {
154-
!metadata.shareType.isEmpty
154+
false // !metadata.shareType.isEmpty // Interim solution to counteract Finder misleadingly displaying shared items with an iCloud branded banner.
155155
}
156156

157157
public var isSharedByCurrentUser: Bool {
158-
isShared && metadata.ownerId == account.id
158+
false // isShared && metadata.ownerId == account.id // Interim solution to counteract Finder misleadingly displaying shared items with an iCloud branded banner.
159159
}
160160

161161
public var ownerNameComponents: PersonNameComponents? {

Tests/NextcloudFileProviderKitTests/ItemPropertyTests.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ final class ItemPropertyTests: XCTestCase {
866866
remoteInterface: MockRemoteInterface(),
867867
dbManager: Self.dbManager
868868
)
869-
XCTAssertTrue(sharedItem.isShared)
870-
XCTAssertTrue(sharedItem.isSharedByCurrentUser)
869+
XCTAssertFalse(sharedItem.isShared)
870+
XCTAssertFalse(sharedItem.isSharedByCurrentUser)
871871
XCTAssertNil(sharedItem.ownerNameComponents) // Should be nil if it is shared by us
872872

873873
var sharedByOtherMetadata = sharedMetadata
@@ -880,11 +880,9 @@ final class ItemPropertyTests: XCTestCase {
880880
remoteInterface: MockRemoteInterface(),
881881
dbManager: Self.dbManager
882882
)
883-
XCTAssertTrue(sharedByOtherTime.isShared)
883+
XCTAssertFalse(sharedByOtherTime.isShared)
884884
XCTAssertFalse(sharedByOtherTime.isSharedByCurrentUser)
885-
XCTAssertNotNil(sharedByOtherTime.ownerNameComponents)
886-
XCTAssertEqual(sharedByOtherTime.ownerNameComponents?.givenName, "Claudio")
887-
XCTAssertEqual(sharedByOtherTime.ownerNameComponents?.familyName, "Cambra")
885+
XCTAssertNil(sharedByOtherTime.ownerNameComponents)
888886

889887
var notSharedMetadata =
890888
SendableItemMetadata(ocId: "test-id", fileName: "test.txt", account: Self.account)

0 commit comments

Comments
 (0)