diff --git a/Sources/NextcloudKit/NKCommon.swift b/Sources/NextcloudKit/NKCommon.swift index a2a56df4..598e8d2e 100644 --- a/Sources/NextcloudKit/NKCommon.swift +++ b/Sources/NextcloudKit/NKCommon.swift @@ -411,6 +411,7 @@ public struct NKCommon: Sendable { guard let groupDefaults = UserDefaults(suiteName: groupIdentifier) else { return } + let capabilities = NCCapabilities.shared.getCapabilitiesBlocking(for: account) /// Unavailable if errorCode == 503 { @@ -429,7 +430,7 @@ public struct NKCommon: Sendable { groupDefaults.set(array, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) } /// ToS - } else if errorCode == 403 { + } else if errorCode == 403, capabilities.termsOfService { var array = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) as? [String] ?? [] if !array.contains(account) { diff --git a/Sources/NextcloudKit/NextcloudKitBackground.swift b/Sources/NextcloudKit/NextcloudKitBackground.swift index 32f07e9e..5ab72d2b 100644 --- a/Sources/NextcloudKit/NextcloudKitBackground.swift +++ b/Sources/NextcloudKit/NextcloudKitBackground.swift @@ -21,7 +21,7 @@ public final class NKBackground: NSObject, URLSessionTaskDelegate, URLSessionDel var url: URL? let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) - /// Check error in groupDefaults + /// Check if error is in groupDefaults if let array = groupDefaults?.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String], array.contains(account) { return (nil, .unauthorizedError) @@ -77,7 +77,7 @@ public final class NKBackground: NSObject, URLSessionTaskDelegate, URLSessionDel var uploadSession: URLSession? let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) - /// Check error in groupDefaults + /// Check if error is in groupDefaults if let array = groupDefaults?.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String], array.contains(account) { return (nil, .unauthorizedError)