Commit 7282504f authored by Ronan's avatar Ronan

feat(AssistantModel): if no xmlrpc_uri given in login, use addOtherSipAccount directly

parent 6de72ed5
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Login fehlgeschlagen. Bitte überprüfen Sie Ihre Telefonnummer.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Dieses Konto kann nicht hinzugefügt werden.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Login failed. Please check your phone number.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Unable to add this account.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>La connection a échoué. Merci de vérifier votre numéro.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Impossible d&apos;ajouter ce compte.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>ログインに失敗しました。電話番号を確認して下さい。</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>このアカウントを追加出来ませんでした。</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Prisijungimas nepavyko. Patikrinkite savo telefono numerį.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Nepavyko pridėti šios paskyros.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Falha na autenticação. Por favor, verifique o seu número de telefone.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Não é possível adicionar esta conta.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Не удалось войти. Пожалуйста проверьте правильность ввода номера телефона.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Не удалось добавить этот аккаунт.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Inloggningen misslyckades. Kolla ditt telefonnummer.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Det gick inte att lägga till det här kontot.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -213,6 +213,10 @@
<source>loginWithPhoneNumberFailed</source>
<translation>Giriş başarısız. Lütfen telefon numaranızı denetleyin.</translation>
</message>
<message>
<source>unableToAddAccount</source>
<translation>Bu hesap eklenemiyor.</translation>
</message>
</context>
<context>
<name>AuthenticationRequest</name>
......
......@@ -167,10 +167,23 @@ void AssistantModel::create () {
}
void AssistantModel::login () {
if (!mCountryCode.isEmpty())
if (!mCountryCode.isEmpty()) {
mAccountCreator->recoverAccount();
else
return;
}
shared_ptr<linphone::Config> config(CoreManager::getInstance()->getCore()->getConfig());
if (!config->getString("assistant", "xmlrpc_url", "").empty()) {
mAccountCreator->isAccountExist();
return;
}
// No verification if no xmlrpc url. Use addOtherSipAccount directly.
QVariantMap map;
map["sipDomain"] = Utils::coreStringToAppString(config->getString("assistant", "domain", ""));
map["username"] = getUsername();
map["password"] = getPassword();
emit loginStatusChanged(addOtherSipAccount(map) ? QString("") : tr("unableToAddAccount"));
}
void AssistantModel::reset () {
......@@ -202,7 +215,10 @@ bool AssistantModel::addOtherSipAccount (const QVariantMap &map) {
shared_ptr<linphone::Address> address = factory->createAddress(
Utils::appStringToCoreString(QStringLiteral("sip:%1").arg(domain))
);
address->setTransport(LinphoneUtils::stringToTransportType(map["transport"].toString()));
const QString &transport(map["transport"].toString());
if (!transport.isEmpty())
address->setTransport(LinphoneUtils::stringToTransportType(transport));
if (proxyConfig->setServerAddr(address->asString())) {
qWarning() << QStringLiteral("Unable to add server address: `%1`.")
......
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