Commit 8d51bfb6 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/components/assistant/AssistantModel): login user correctly with username/password

parent b2a29c39
...@@ -33,10 +33,6 @@ using namespace std; ...@@ -33,10 +33,6 @@ using namespace std;
// ============================================================================= // =============================================================================
inline bool dealWithPhoneNumber (const shared_ptr<linphone::AccountCreator> &creator) {
return creator->getEmail().empty();
}
class AssistantModel::Handlers : public linphone::AccountCreatorListener { class AssistantModel::Handlers : public linphone::AccountCreatorListener {
public: public:
Handlers (AssistantModel *assistant) { Handlers (AssistantModel *assistant) {
...@@ -88,7 +84,7 @@ private: ...@@ -88,7 +84,7 @@ private:
status == linphone::AccountCreatorStatusAccountActivated || status == linphone::AccountCreatorStatusAccountActivated ||
status == linphone::AccountCreatorStatusAccountAlreadyActivated status == linphone::AccountCreatorStatusAccountAlreadyActivated
) { ) {
if (dealWithPhoneNumber(creator)) { if (creator->getEmail().empty()) {
shared_ptr<linphone::ProxyConfig> proxyConfig = creator->createProxyConfig(); shared_ptr<linphone::ProxyConfig> proxyConfig = creator->createProxyConfig();
Q_ASSERT(proxyConfig != nullptr); Q_ASSERT(proxyConfig != nullptr);
} }
...@@ -156,7 +152,7 @@ AssistantModel::AssistantModel (QObject *parent) : QObject(parent) { ...@@ -156,7 +152,7 @@ AssistantModel::AssistantModel (QObject *parent) : QObject(parent) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void AssistantModel::activate () { void AssistantModel::activate () {
if (dealWithPhoneNumber(mAccountCreator)) if (mAccountCreator->getEmail().empty())
mAccountCreator->activateAccount(); mAccountCreator->activateAccount();
else else
mAccountCreator->isAccountActivated(); mAccountCreator->isAccountActivated();
...@@ -167,7 +163,7 @@ void AssistantModel::create () { ...@@ -167,7 +163,7 @@ void AssistantModel::create () {
} }
void AssistantModel::login () { void AssistantModel::login () {
if (dealWithPhoneNumber(mAccountCreator)) if (!mCountryCode.isEmpty())
mAccountCreator->recoverAccount(); mAccountCreator->recoverAccount();
else else
mAccountCreator->isAccountExist(); mAccountCreator->isAccountExist();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment