diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 6f14261fc..56f7a1822 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -381,6 +381,21 @@ void App::setSelf(QSharedPointer(me)) { }); } }); + mCoreModelConnection->makeConnectToModel( + &CoreModel::accountAdded, + [this](const std::shared_ptr &core, const std::shared_ptr &account) { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + if (CoreModel::getInstance()->mConfigStatus == linphone::ConfiguringState::Successful) { + bool accountConnected = account && account->getState() == linphone::RegistrationState::Ok; + mCoreModelConnection->invokeToCore([this, accountConnected]() { + mustBeInMainThread(log().arg(Q_FUNC_INFO)); + // There is an account added by a remote provisioning, force switching to main page + // because the account may not be connected already + QMetaObject::invokeMethod(mMainWindow, "openMainPage", Qt::DirectConnection, + Q_ARG(QVariant, accountConnected)); + }); + } + }); // Synchronize state for because linphoneCore was ran before any connections. mCoreModelConnection->invokeToModel([this]() {