Use accountStateFromFileProviderDomainIdentifier method in authenticateExtension

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-01-02 17:04:45 +08:00
parent 6d4e785ebb
commit 43b7ae55df

View file

@ -17,6 +17,7 @@
#include <QLoggingCategory>
#include "gui/accountmanager.h"
#include "gui/macOS/fileproviderdomainmanager.h"
#include "gui/macOS/fileproviderxpc_mac_utils.h"
namespace OCC::Mac {
@ -48,9 +49,7 @@ void FileProviderXPC::configureExtensions()
void FileProviderXPC::authenticateExtension(const QString &extensionAccountId) const
{
const auto accountManager = AccountManager::instance();
Q_ASSERT(accountManager);
const auto accountState = accountManager->accountFromUserId(extensionAccountId);
const auto accountState = FileProviderDomainManager::accountStateFromFileProviderDomainIdentifier(extensionAccountId);
if (!accountState) {
qCWarning(lcFileProviderXPC) << "Account state is null for received account"
<< extensionAccountId;