From 8c5ebd8b5e213218be0f2eaea4f8da68b113c75b Mon Sep 17 00:00:00 2001 From: gaelle Date: Mon, 24 Feb 2025 11:50:20 +0100 Subject: [PATCH] force accounts initialization on oidc authenticated --- Linphone/core/App.cpp | 2 +- Linphone/core/account/AccountList.cpp | 5 +++++ Linphone/model/auth/OIDCModel.cpp | 1 + Linphone/model/core/CoreModel.hpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 65709276..01f2c383 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -1110,7 +1110,7 @@ void App::setSysTrayIcon() { }); } - QAction *quitAction = new QAction(tr("Quit"), root); + QAction *quitAction = new QAction(tr("Quitter"), root); root->connect(quitAction, &QAction::triggered, this, &App::quit); // trayIcon: Left click actions. diff --git a/Linphone/core/account/AccountList.cpp b/Linphone/core/account/AccountList.cpp index 48c19f33..e6f026f4 100644 --- a/Linphone/core/account/AccountList.cpp +++ b/Linphone/core/account/AccountList.cpp @@ -84,6 +84,11 @@ void AccountList::setSelf(QSharedPointer me) { }); mModelConnection->makeConnectToModel(&CoreModel::accountRemoved, [this] { emit lUpdate(); }); mModelConnection->makeConnectToModel(&CoreModel::accountAdded, [this] { emit lUpdate(true); }); + // force initialization on bearer account added to automatically go on the main page + // with the open id account + mModelConnection->makeConnectToModel(&CoreModel::bearerAccountAdded, [this] { + setInitialized(false); + emit lUpdate(true); }); mModelConnection->makeConnectToModel( &CoreModel::globalStateChanged, diff --git a/Linphone/model/auth/OIDCModel.cpp b/Linphone/model/auth/OIDCModel.cpp index 7ff51cd3..a5755496 100644 --- a/Linphone/model/auth/OIDCModel.cpp +++ b/Linphone/model/auth/OIDCModel.cpp @@ -198,5 +198,6 @@ void OIDCModel::setBearers() { mAuthInfo->setRefreshToken(refreshBearer); mAuthInfo->setAccessToken(accessBearer); CoreModel::getInstance()->getCore()->addAuthInfo(mAuthInfo); + emit CoreModel::getInstance()->bearerAccountAdded(); emit finished(); } diff --git a/Linphone/model/core/CoreModel.hpp b/Linphone/model/core/CoreModel.hpp index 02c354ec..4aa6e61b 100644 --- a/Linphone/model/core/CoreModel.hpp +++ b/Linphone/model/core/CoreModel.hpp @@ -69,6 +69,7 @@ signals: void friendCreated(const std::shared_ptr &f); void friendRemoved(const std::shared_ptr &f); void friendUpdated(const std::shared_ptr &f); + void bearerAccountAdded(); void conferenceInfoCreated(const std::shared_ptr &confInfo); void unreadNotificationsChanged(); void requestFetchConfig(QString path);