From 163f9ba067f2f732ee1c12a52b3bfb78ba1d083e Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 10 Jul 2023 10:48:26 +0200 Subject: [PATCH] Fix recovering account from phone. --- .../src/components/assistant/AssistantModel.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/linphone-app/src/components/assistant/AssistantModel.cpp b/linphone-app/src/components/assistant/AssistantModel.cpp index 4def4e54b..ac1067c41 100644 --- a/linphone-app/src/components/assistant/AssistantModel.cpp +++ b/linphone-app/src/components/assistant/AssistantModel.cpp @@ -132,8 +132,14 @@ private: bool error = false; QVariantMap description = doc.toVariant().toMap(); creator->setToken(description.value("token").toString().toStdString()); - emit mAssistant->createStatusChanged("Creating account"); - creator->createAccount();// it will automatically use the account creation token. + // it will automatically use the account creation token. + if (!mAssistant->mCountryCode.isEmpty()) { + emit mAssistant->createStatusChanged("Recovering account"); + creator->recoverAccount(); + }else{ + emit mAssistant->createStatusChanged("Creating account"); + creator->createAccount(); + } }else QTimer::singleShot(2000, [creator](){ creator->requestAccountCreationTokenUsingRequestToken(); @@ -245,8 +251,8 @@ void AssistantModel::create () { void AssistantModel::login () { setIsProcessing(true); - if (!mCountryCode.isEmpty()) { - mAccountCreator->recoverAccount(); + if (!mCountryCode.isEmpty()) {// Recovering account from phone + mAccountCreator->requestAccountCreationRequestToken(); return; }