diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Extensions/Logger+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Extensions/Logger+Extensions.swift index 54e3e599a..960171034 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Extensions/Logger+Extensions.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Extensions/Logger+Extensions.swift @@ -13,6 +13,7 @@ extension Logger { static let actionViewController = Logger(subsystem: subsystem, category: "actionViewController") static let shareCapabilities = Logger(subsystem: subsystem, category: "shareCapabilities") static let shareController = Logger(subsystem: subsystem, category: "shareController") + static let shareeDataSource = Logger(subsystem: subsystem, category: "shareeDataSource") static let sharesDataSource = Logger(subsystem: subsystem, category: "sharesDataSource") static let shareOptionsView = Logger(subsystem: subsystem, category: "shareOptionsView") static let shareViewController = Logger(subsystem: subsystem, category: "shareViewController") diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareeSuggestionsDataSource.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareeSuggestionsDataSource.swift index f31db0ee1..17a7140b5 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareeSuggestionsDataSource.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareeSuggestionsDataSource.swift @@ -18,4 +18,23 @@ class ShareeSuggestionsDataSource: SuggestionsDataSource { init(kit: NextcloudKit) { self.kit = kit } + + private func fetchSharees(search: String) async -> [NKSharee] { + return await withCheckedContinuation { continuation in + kit.searchSharees( + search: inputString, + page: 1, + perPage: 20, + completion: { account, sharees, data, error in + defer { continuation.resume(returning: sharees ?? []) } + guard error == .success else { + Logger.shareeDataSource.error( + "Error fetching sharees: \(error.description, privacy: .public)" + ) + return + } + } + ) + } + } }