Add method to FPUIExtensionServiceSource to get extension account details
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 27 Feb 2024 14:47:43 +0000 (22:47 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 17 Apr 2024 08:38:48 +0000 (16:38 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/FPUIExtensionService.swift
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Services/FPUIExtensionServiceSource.swift

index 5d80b1fa9bc8d137b9aaccc70115be65231e384d..4cfa0fe4d9cf34d14bce9141de757b29b115dd37 100644 (file)
@@ -14,4 +14,5 @@ let fpUiExtensionServiceName = NSFileProviderServiceName(
 
 @objc protocol FPUIExtensionService {
     func shares(forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async -> [NKShare]?
+    func credentials() async -> NSDictionary
 }
index fc78889932c64edeb83612941ce35ced92f1e031..af4c39a902d31c5732d3b083d1479918eb0ba749 100644 (file)
@@ -47,4 +47,8 @@ class FPUIExtensionServiceSource: NSObject, NSFileProviderServiceSource, NSXPCLi
         )
         return await controller.fetch()
     }
+
+    func credentials() async -> NSDictionary {
+        return (fpExtension.ncAccount?.dictionary() ?? [:]) as NSDictionary
+    }
 }