diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 0cb5dfcfe..d3c8bb9d6 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -104,49 +104,55 @@ AccountManager - + assistant_account_login_already_connected_error "The account is already connected" Das Konto ist bereits verbunden - + assistant_account_login_outbound_proxy_uri_error Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) - + assistant_account_login_proxy_address_error "Unable to create proxy address. Please check the domain name." Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname. - + assistant_account_login_address_configuration_error "Unable to configure address: `%1`." Folgende Adresse konnte nicht konfiguriert werden: `%1`. - + + assistant_account_login_registrar_uri_error + Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + + + + assistant_account_login_params_configuration_error "Unable to configure account settings." Kontoeinstellungen konnten nicht konfiguriert werden. - + assistant_account_login_forbidden_error "Username and password do not match" Benutzername und Passwort stimmen nicht überein - + assistant_account_login_error "Error during connection, please verify your parameters" Fehler bei der Verbindung - + assistant_account_add_error "Unable to add account." Konto konnte nicht hinzugefügt werden. diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 75aa8f47d..5cd6b761b 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -104,49 +104,55 @@ AccountManager - + assistant_account_login_already_connected_error "The account is already connected" The account is already connected - + assistant_account_login_outbound_proxy_uri_error Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) - + assistant_account_login_proxy_address_error "Unable to create proxy address. Please check the domain name." Unable to create proxy address. Please check the domain name. - + assistant_account_login_address_configuration_error "Unable to configure address: `%1`." Unable to configure address: `%1`. - + + assistant_account_login_registrar_uri_error + Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + + + assistant_account_login_params_configuration_error "Unable to configure account settings." Unable to configure account settings. - + assistant_account_login_forbidden_error "Username and password do not match" Username and password do not match - + assistant_account_login_error "Error during connection, please verify your parameters" Error during connection - + assistant_account_add_error "Unable to add account." Unable to add account. diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index ed5515b84..b93677902 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -104,49 +104,55 @@ AccountManager - + assistant_account_login_already_connected_error "The account is already connected" Le compte est déjà connecté - + assistant_account_login_outbound_proxy_uri_error Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) L'uri du proxy SIP sortant est invalide. Assurez-vous qu'elle corresponde format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel) - + assistant_account_login_proxy_address_error "Unable to create proxy address. Please check the domain name." Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine. - + assistant_account_login_address_configuration_error "Unable to configure address: `%1`." Impossible de configurer l'adresse : `%1`. - + + assistant_account_login_registrar_uri_error + Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + La registrar uri est invalide. Assurez-vous qu'elle corresponde format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel) + + + assistant_account_login_params_configuration_error "Unable to configure account settings." Impossible de configurer les paramètres du compte. - + assistant_account_login_forbidden_error "Username and password do not match" Le couple identifiant mot de passe ne correspond pas - + assistant_account_login_error "Error during connection, please verify your parameters" Erreur durant la connexion, veuillez vérifier vos paramètres - + assistant_account_add_error "Unable to add account." Impossible d'ajouter le compte. diff --git a/Linphone/model/account/AccountManager.cpp b/Linphone/model/account/AccountManager.cpp index 6f414ecf6..da769e0d0 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -31,6 +31,7 @@ #include "core/path/Paths.hpp" #include "model/core/CoreModel.hpp" +#include "model/setting/SettingsModel.hpp" #include "model/tool/ToolModel.hpp" #include "tool/Utils.hpp" @@ -96,23 +97,10 @@ bool AccountManager::login(QString username, } if (!displayName.isEmpty()) identity->setDisplayName(Utils::appStringToCoreString(displayName)); - if (!registrarUri.isEmpty()) { - auto linRegistrarUri = ToolModel::interpretUrl(registrarUri); - params->setServerAddress(linRegistrarUri); - } - if (!outboundProxyAddress.isEmpty()) { - auto linOutboundProxyAddress = factory->createAddress(Utils::appStringToCoreString(outboundProxyAddress)); - if (linOutboundProxyAddress) params->setRoutesAddresses({linOutboundProxyAddress}); - else { - //: Outbound proxy uri is invalid. Please make sure it matches the following format : - //: sip:host>:;transport= (: is optional) - *errorMessage = tr("assistant_account_login_outbound_proxy_uri_error"); - return false; - } - } + if (!domain.isEmpty()) { identity->setDomain(Utils::appStringToCoreString(domain)); - if (QString::compare(domain, "sip.linphone.org")) { + if (QString::compare(domain, SettingsModel::getInstance()->getDefaultDomain())) { params->setLimeServerUrl(""); auto computedServerAddress = factory->createAddress(Utils::appStringToCoreString(QStringLiteral("sip:%1").arg(domain))); @@ -136,6 +124,28 @@ bool AccountManager::login(QString username, return false; } + if (!registrarUri.isEmpty()) { + auto linRegistrarUri = factory->createAddress(Utils::appStringToCoreString(registrarUri)); + if (linRegistrarUri) params->setServerAddress(linRegistrarUri); + else { + //: Registrar uri is invalid. Please make sure it matches the following format : + //: sip:host>:;transport= (: is optional) + *errorMessage = tr("assistant_account_login_registrar_uri_error"); + return false; + } + } + + if (!outboundProxyAddress.isEmpty()) { + auto linOutboundProxyAddress = factory->createAddress(Utils::appStringToCoreString(outboundProxyAddress)); + if (linOutboundProxyAddress) params->setRoutesAddresses({linOutboundProxyAddress}); + else { + //: Outbound proxy uri is invalid. Please make sure it matches the following format : + //: sip:host>:;transport= (: is optional) + *errorMessage = tr("assistant_account_login_outbound_proxy_uri_error"); + return false; + } + } + if (account->setParams(params)) { //: "Unable to configure account settings." *errorMessage = tr("assistant_account_login_params_configuration_error"); @@ -175,6 +185,7 @@ bool AccountManager::login(QString username, } emit registrationStateChanged(state, account->getError(), errorMessage); }); + auto status = core->addAccount(account); if (status == -1) { //: "Unable to add account."