From 7451bdd488d37eabea468e10c81f54b3124af542 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 6 Nov 2023 17:12:05 +0100 Subject: [PATCH] Update SDK and adapt code for new FlexiAPI (QRCode). Fix ispell compilation error. --- external/ispell | 2 +- .../components/assistant/AssistantModel.cpp | 32 +++++++++---------- linphone-app/src/config.h.cmake | 3 +- linphone-sdk | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/external/ispell b/external/ispell index b4ac0ab97..05574fe16 160000 --- a/external/ispell +++ b/external/ispell @@ -1 +1 @@ -Subproject commit b4ac0ab9772904732e98d5d402b553556bd4ce78 +Subproject commit 05574fe160222c3d0b6283c1433c9b087271fad1 diff --git a/linphone-app/src/components/assistant/AssistantModel.cpp b/linphone-app/src/components/assistant/AssistantModel.cpp index 0feb3d939..6b627eefe 100644 --- a/linphone-app/src/components/assistant/AssistantModel.cpp +++ b/linphone-app/src/components/assistant/AssistantModel.cpp @@ -33,7 +33,7 @@ #endif #ifdef ENABLE_QRCODE -#include +#include #endif #include @@ -532,28 +532,28 @@ void AssistantModel::createTestAccount(){ } void AssistantModel::generateQRCode(){ #ifdef ENABLE_QRCODE - auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); + auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); flexiAPIClient ->accountProvision() - ->then([this](FlexiAPIClient::Response response){ + ->then([this](LinphonePrivate::FlexiAPIClient::Response response){ emit newQRCodeReceived(response.json()["provisioning_token"].asCString()); }) - ->error([this](FlexiAPIClient::Response response){ + ->error([this](LinphonePrivate::FlexiAPIClient::Response response){ emit newQRCodeNotReceived(Utils::coreStringToAppString(response.body), response.code); }); #endif } void AssistantModel::requestQRCode(){ #ifdef ENABLE_QRCODE - auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); + auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); flexiAPIClient ->accountAuthTokenCreate() - ->then([this](FlexiAPIClient::Response response) { + ->then([this](LinphonePrivate::FlexiAPIClient::Response response) { mToken = response.json()["token"].asCString(); emit newQRCodeReceived(mToken); QTimer::singleShot(5000, this, &AssistantModel::checkLinkingAccount); - })->error([this](FlexiAPIClient::Response response){ + })->error([this](LinphonePrivate::FlexiAPIClient::Response response){ qWarning() << response.code << " => " << response.body.c_str(); emit newQRCodeNotReceived(Utils::coreStringToAppString(response.body), response.code); }); @@ -568,12 +568,12 @@ void AssistantModel::newQRCodeNotReceivedTest(){ } void AssistantModel::checkLinkingAccount(){ #ifdef ENABLE_QRCODE - auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); + auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); flexiAPIClient ->accountApiKeyFromAuthTokenGenerate(mToken.toStdString()) - ->then([this](FlexiAPIClient::Response response)mutable{ + ->then([this](LinphonePrivate::FlexiAPIClient::Response response)mutable{ emit apiReceived(Utils::coreStringToAppString(response.json()["api_key"].asCString())); - })->error([this](FlexiAPIClient::Response){ + })->error([this](LinphonePrivate::FlexiAPIClient::Response){ QTimer::singleShot(5000, this, &AssistantModel::checkLinkingAccount); }); #endif @@ -581,12 +581,12 @@ void AssistantModel::checkLinkingAccount(){ void AssistantModel::onApiReceived(QString apiKey){ #ifdef ENABLE_QRCODE - auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); + auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); flexiAPIClient->setApiKey(Utils::appStringToCoreString(apiKey).c_str()) ->accountProvision() - ->then([this](FlexiAPIClient::Response response){ + ->then([this](LinphonePrivate::FlexiAPIClient::Response response){ emit provisioningTokenReceived(response.json()["provisioning_token"].asCString()); - })->error([this](FlexiAPIClient::Response response){ + })->error([this](LinphonePrivate::FlexiAPIClient::Response response){ //it provisioningTokenReceived("token"); emit this->newQRCodeNotReceived("Cannot generate a provisioning key"+(response.body.empty() ? "" : " : " +Utils::coreStringToAppString(response.body)), response.code); }); @@ -599,14 +599,14 @@ void AssistantModel::onQRCodeFound(const std::string & result){ void AssistantModel::attachAccount(const QString& token){ #ifdef ENABLE_QRCODE - auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); + auto flexiAPIClient = make_shared(CoreManager::getInstance()->getCore()->cPtr()); flexiAPIClient-> accountAuthTokenAttach(Utils::appStringToCoreString(token)) - ->then([this](FlexiAPIClient::Response response){ + ->then([this](LinphonePrivate::FlexiAPIClient::Response response){ qWarning() << "Attached"; emit qRCodeAttached(); }) - ->error([this](FlexiAPIClient::Response response){ + ->error([this](LinphonePrivate::FlexiAPIClient::Response response){ emit qRCodeNotAttached("Cannot attach"+ (response.body.empty() ? "" : " : " +Utils::coreStringToAppString(response.body)), response.code); }); #endif diff --git a/linphone-app/src/config.h.cmake b/linphone-app/src/config.h.cmake index dca99094b..93157a450 100644 --- a/linphone-app/src/config.h.cmake +++ b/linphone-app/src/config.h.cmake @@ -33,10 +33,11 @@ #cmakedefine APPLICATION_SEMVER "${APPLICATION_SEMVER}" #cmakedefine COPYRIGHT_RANGE_DATE "${COPYRIGHT_RANGE_DATE}" #cmakedefine ENABLE_UPDATE_CHECK 1 +#cmakedefine ENABLE_QRCODE #cmakedefine EXECUTABLE_NAME "${EXECUTABLE_NAME}" #cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}" #cmakedefine ENABLE_APP_WEBVIEW "${ENABLE_APP_WEBVIEW}" #cmakedefine QTKEYCHAIN_TARGET_NAME ${QTKEYCHAIN_TARGET_NAME} #cmakedefine PDF_ENABLED -#endif \ No newline at end of file +#endif diff --git a/linphone-sdk b/linphone-sdk index 40373878e..5c14f98d4 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 40373878e26ab10c31c7237f1a22758aac3939ab +Subproject commit 5c14f98d4e10714fe16aa7a4a9bffcf7d69aab07