mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Add share fetching routine to FPUIExtensionService
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
af93122445
commit
6dad778498
2 changed files with 12 additions and 2 deletions
|
@ -5,12 +5,13 @@
|
|||
// Created by Claudio Cambra on 21/2/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import FileProvider
|
||||
import NextcloudKit
|
||||
|
||||
let fpUiExtensionServiceName = NSFileProviderServiceName(
|
||||
"com.nextcloud.desktopclient.FPUIExtensionService"
|
||||
)
|
||||
|
||||
@objc protocol FPUIExtensionService {
|
||||
|
||||
func shares(forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async -> [NKShare]?
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import FileProvider
|
||||
import Foundation
|
||||
import NextcloudKit
|
||||
import OSLog
|
||||
|
||||
class FPUIExtensionServiceSource: NSObject, NSFileProviderServiceSource, NSXPCListenerDelegate, FPUIExtensionService {
|
||||
|
@ -38,4 +39,12 @@ class FPUIExtensionServiceSource: NSObject, NSFileProviderServiceSource, NSXPCLi
|
|||
|
||||
//MARK: - FPUIExtensionService protocol methods
|
||||
|
||||
func shares(
|
||||
forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier
|
||||
) async -> [NKShare]? {
|
||||
let controller = ItemSharesController(
|
||||
itemIdentifier: itemIdentifier, parentExtension: fpExtension
|
||||
)
|
||||
return await controller.fetch()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue