mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
Update SDK and adapt code for new FlexiAPI (QRCode).
Fix ispell compilation error.
This commit is contained in:
parent
f61c11759f
commit
7451bdd488
4 changed files with 20 additions and 19 deletions
2
external/ispell
vendored
2
external/ispell
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit b4ac0ab9772904732e98d5d402b553556bd4ce78
|
||||
Subproject commit 05574fe160222c3d0b6283c1433c9b087271fad1
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef ENABLE_QRCODE
|
||||
#include <linphone/FlexiAPIClient.hh>
|
||||
#include <linphone/flexi-api-client.h>
|
||||
#endif
|
||||
|
||||
#include <QtDebug>
|
||||
|
|
@ -532,28 +532,28 @@ void AssistantModel::createTestAccount(){
|
|||
}
|
||||
void AssistantModel::generateQRCode(){
|
||||
#ifdef ENABLE_QRCODE
|
||||
auto flexiAPIClient = make_shared<FlexiAPIClient>(CoreManager::getInstance()->getCore()->cPtr());
|
||||
auto flexiAPIClient = make_shared<LinphonePrivate::FlexiAPIClient>(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<FlexiAPIClient>(CoreManager::getInstance()->getCore()->cPtr());
|
||||
auto flexiAPIClient = make_shared<LinphonePrivate::FlexiAPIClient>(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<FlexiAPIClient>(CoreManager::getInstance()->getCore()->cPtr());
|
||||
auto flexiAPIClient = make_shared<LinphonePrivate::FlexiAPIClient>(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<FlexiAPIClient>(CoreManager::getInstance()->getCore()->cPtr());
|
||||
auto flexiAPIClient = make_shared<LinphonePrivate::FlexiAPIClient>(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<FlexiAPIClient>(CoreManager::getInstance()->getCore()->cPtr());
|
||||
auto flexiAPIClient = make_shared<LinphonePrivate::FlexiAPIClient>(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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 40373878e26ab10c31c7237f1a22758aac3939ab
|
||||
Subproject commit 5c14f98d4e10714fe16aa7a4a9bffcf7d69aab07
|
||||
Loading…
Add table
Reference in a new issue