diff --git a/linphone-app/src/components/assistant/AssistantModel.cpp b/linphone-app/src/components/assistant/AssistantModel.cpp index ac1067c41..e99efce3a 100644 --- a/linphone-app/src/components/assistant/AssistantModel.cpp +++ b/linphone-app/src/components/assistant/AssistantModel.cpp @@ -187,9 +187,9 @@ private: } void onRecoverAccount ( - const shared_ptr &, + const shared_ptr &accountCreator, linphone::AccountCreator::Status status, - const string & + const string &response ) override { if (status == linphone::AccountCreator::Status::RequestOk) { CoreManager::getInstance()->getSipAddressesModel()->reset(); @@ -204,7 +204,21 @@ private: } mAssistant->setIsProcessing(false); } - + virtual void onLoginLinphoneAccount( + const std::shared_ptr & creator, + linphone::AccountCreator::Status status, + const std::string & response) override { + if( status == linphone::AccountCreator::Status::RequestOk){ + createAccount(creator); + CoreManager::getInstance()->getSipAddressesModel()->reset(); + emit mAssistant->activateStatusChanged(QString("")); + } else { + if (status == linphone::AccountCreator::Status::RequestFailed) + emit mAssistant->activateStatusChanged(tr("requestFailed")); + else + emit mAssistant->activateStatusChanged(tr("smsActivationFailed")); + } + } private: AssistantModel *mAssistant; }; @@ -237,9 +251,11 @@ AssistantModel::~AssistantModel(){ void AssistantModel::activate () { setIsProcessing(true); - if (mAccountCreator->getEmail().empty()) - mAccountCreator->activateAccount(); - else + if (mAccountCreator->getEmail().empty()){ + if(mAccountCreator->getUsername().empty()) + mAccountCreator->setUsername(mAccountCreator->getPhoneNumber()); + mAccountCreator->loginLinphoneAccount();// It will detect if phone is an alias or not. + }else mAccountCreator->isAccountActivated(); } @@ -251,6 +267,8 @@ void AssistantModel::create () { void AssistantModel::login () { setIsProcessing(true); + if(mAccountCreator->getUsername().empty()) + mAccountCreator->setUsername(mAccountCreator->getPhoneNumber()); if (!mCountryCode.isEmpty()) {// Recovering account from phone mAccountCreator->requestAccountCreationRequestToken(); return; diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index df0d21880..1723b07c9 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -442,6 +442,7 @@ Rectangle { onTextChanged: {// This slot can be call before the item has been completed because of Rich text. So the cache must not take it account. if(componentReady) { proxyModel.cachedText=text + Logic.handleTextChanged(textArea.getText()) } } onValidText: {