From: Claudio Cambra Date: Mon, 30 Sep 2024 06:05:33 +0000 (+0800) Subject: Fetch user profile (and user ID) when setting up domain account X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~58^2^2~128^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cbf4ea571ec545e59c361117efe37413144f25fe;p=nextcloud-desktop.git Fetch user profile (and user ID) when setting up domain account Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+ClientInterface.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+ClientInterface.swift index ad9c24d03..878569945 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+ClientInterface.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+ClientInterface.swift @@ -163,6 +163,26 @@ extension FileProviderExtension: NSFileProviderServicing, ChangeNotificationInte remoteInterface: ncKit, changeNotificationInterface: self, domain: domain ) ncKit.setup(delegate: changeObserver) + + Task { + let (_, profile, _, error) = await ncKit.fetchUserProfile() + guard error == .success, let profile else { + // Note that since the authentication check checks for the user profile, this should + // not really occur + Logger.fileProviderExtension.error( + """ + Unable to get user profile for user \(user, privacy: .public) + at server \(serverUrl, privacy: .public) + error: \(error.errorDescription, privacy: .public) + """ + ) + return + } + ncKit.setup(user: user, userId: profile.userId, password: password, urlBase: serverUrl) + semaphore.signal() + } + semaphore.wait() + signalEnumeratorAfterAccountSetup() }