mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-26 08:18:08 +00:00
feat(src/components/assistant/AssistantModel): provide a dealWithPhoneNumber function
This commit is contained in:
parent
3633ee5009
commit
c0686613dc
1 changed files with 7 additions and 3 deletions
|
|
@ -32,6 +32,10 @@ using namespace std;
|
|||
|
||||
// =============================================================================
|
||||
|
||||
inline bool dealWithPhoneNumber (const shared_ptr<linphone::AccountCreator> &creator) {
|
||||
return creator->getEmail().empty();
|
||||
}
|
||||
|
||||
class AssistantModel::Handlers : public linphone::AccountCreatorListener {
|
||||
public:
|
||||
Handlers (AssistantModel *assistant) {
|
||||
|
|
@ -83,7 +87,7 @@ private:
|
|||
status == linphone::AccountCreatorStatusAccountActivated ||
|
||||
status == linphone::AccountCreatorStatusAccountAlreadyActivated
|
||||
) {
|
||||
if (creator->getEmail().empty()) {
|
||||
if (dealWithPhoneNumber(creator)) {
|
||||
shared_ptr<linphone::ProxyConfig> proxyConfig = creator->createProxyConfig();
|
||||
Q_ASSERT(proxyConfig != nullptr);
|
||||
}
|
||||
|
|
@ -151,7 +155,7 @@ AssistantModel::AssistantModel (QObject *parent) : QObject(parent) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void AssistantModel::activate () {
|
||||
if (mAccountCreator->getEmail().empty())
|
||||
if (dealWithPhoneNumber(mAccountCreator))
|
||||
mAccountCreator->activateAccount();
|
||||
else
|
||||
mAccountCreator->isAccountActivated();
|
||||
|
|
@ -162,7 +166,7 @@ void AssistantModel::create () {
|
|||
}
|
||||
|
||||
void AssistantModel::login () {
|
||||
if (mAccountCreator->getEmail().empty())
|
||||
if (dealWithPhoneNumber(mAccountCreator))
|
||||
mAccountCreator->recoverAccount();
|
||||
else
|
||||
mAccountCreator->isAccountExist();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue