fix verification when trying to connect to an account that is already connected
This commit is contained in:
parent
7a4adbcbb4
commit
bfbafab84b
4 changed files with 29 additions and 24 deletions
|
|
@ -104,43 +104,43 @@
|
||||||
<context>
|
<context>
|
||||||
<name>AccountManager</name>
|
<name>AccountManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="88"/>
|
<location filename="../../model/account/AccountManager.cpp" line="93"/>
|
||||||
<source>assistant_account_login_already_connected_error</source>
|
<source>assistant_account_login_already_connected_error</source>
|
||||||
<extracomment>"The account is already connected"</extracomment>
|
<extracomment>"The account is already connected"</extracomment>
|
||||||
<translation>Das Konto ist bereits verbunden</translation>
|
<translation>Das Konto ist bereits verbunden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="110"/>
|
<location filename="../../model/account/AccountManager.cpp" line="115"/>
|
||||||
<source>assistant_account_login_proxy_address_error</source>
|
<source>assistant_account_login_proxy_address_error</source>
|
||||||
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
||||||
<translation>Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname.</translation>
|
<translation>Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="123"/>
|
<location filename="../../model/account/AccountManager.cpp" line="128"/>
|
||||||
<source>assistant_account_login_address_configuration_error</source>
|
<source>assistant_account_login_address_configuration_error</source>
|
||||||
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
||||||
<translation>Folgende Adresse konnte nicht konfiguriert werden: `%1`.</translation>
|
<translation>Folgende Adresse konnte nicht konfiguriert werden: `%1`.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="130"/>
|
<location filename="../../model/account/AccountManager.cpp" line="135"/>
|
||||||
<source>assistant_account_login_params_configuration_error</source>
|
<source>assistant_account_login_params_configuration_error</source>
|
||||||
<extracomment>"Unable to configure account settings."</extracomment>
|
<extracomment>"Unable to configure account settings."</extracomment>
|
||||||
<translation>Kontoeinstellungen konnten nicht konfiguriert werden.</translation>
|
<translation>Kontoeinstellungen konnten nicht konfiguriert werden.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="154"/>
|
<location filename="../../model/account/AccountManager.cpp" line="159"/>
|
||||||
<source>assistant_account_login_forbidden_error</source>
|
<source>assistant_account_login_forbidden_error</source>
|
||||||
<extracomment>"Username and password do not match"</extracomment>
|
<extracomment>"Username and password do not match"</extracomment>
|
||||||
<translation>Benutzername und Passwort stimmen nicht überein</translation>
|
<translation>Benutzername und Passwort stimmen nicht überein</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="156"/>
|
<location filename="../../model/account/AccountManager.cpp" line="161"/>
|
||||||
<source>assistant_account_login_error</source>
|
<source>assistant_account_login_error</source>
|
||||||
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
||||||
<translation>Fehler bei der Verbindung</translation>
|
<translation>Fehler bei der Verbindung</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="170"/>
|
<location filename="../../model/account/AccountManager.cpp" line="175"/>
|
||||||
<source>assistant_account_add_error</source>
|
<source>assistant_account_add_error</source>
|
||||||
<extracomment>"Unable to add account."</extracomment>
|
<extracomment>"Unable to add account."</extracomment>
|
||||||
<translation>Konto konnte nicht hinzugefügt werden.</translation>
|
<translation>Konto konnte nicht hinzugefügt werden.</translation>
|
||||||
|
|
|
||||||
|
|
@ -104,43 +104,43 @@
|
||||||
<context>
|
<context>
|
||||||
<name>AccountManager</name>
|
<name>AccountManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="88"/>
|
<location filename="../../model/account/AccountManager.cpp" line="93"/>
|
||||||
<source>assistant_account_login_already_connected_error</source>
|
<source>assistant_account_login_already_connected_error</source>
|
||||||
<extracomment>"The account is already connected"</extracomment>
|
<extracomment>"The account is already connected"</extracomment>
|
||||||
<translation>The account is already connected</translation>
|
<translation>The account is already connected</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="110"/>
|
<location filename="../../model/account/AccountManager.cpp" line="115"/>
|
||||||
<source>assistant_account_login_proxy_address_error</source>
|
<source>assistant_account_login_proxy_address_error</source>
|
||||||
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
||||||
<translation>Unable to create proxy address. Please check the domain name.</translation>
|
<translation>Unable to create proxy address. Please check the domain name.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="123"/>
|
<location filename="../../model/account/AccountManager.cpp" line="128"/>
|
||||||
<source>assistant_account_login_address_configuration_error</source>
|
<source>assistant_account_login_address_configuration_error</source>
|
||||||
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
||||||
<translation>Unable to configure address: `%1`.</translation>
|
<translation>Unable to configure address: `%1`.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="130"/>
|
<location filename="../../model/account/AccountManager.cpp" line="135"/>
|
||||||
<source>assistant_account_login_params_configuration_error</source>
|
<source>assistant_account_login_params_configuration_error</source>
|
||||||
<extracomment>"Unable to configure account settings."</extracomment>
|
<extracomment>"Unable to configure account settings."</extracomment>
|
||||||
<translation>Unable to configure account settings.</translation>
|
<translation>Unable to configure account settings.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="154"/>
|
<location filename="../../model/account/AccountManager.cpp" line="159"/>
|
||||||
<source>assistant_account_login_forbidden_error</source>
|
<source>assistant_account_login_forbidden_error</source>
|
||||||
<extracomment>"Username and password do not match"</extracomment>
|
<extracomment>"Username and password do not match"</extracomment>
|
||||||
<translation>Username and password do not match</translation>
|
<translation>Username and password do not match</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="156"/>
|
<location filename="../../model/account/AccountManager.cpp" line="161"/>
|
||||||
<source>assistant_account_login_error</source>
|
<source>assistant_account_login_error</source>
|
||||||
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
||||||
<translation>Error during connection</translation>
|
<translation>Error during connection</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="170"/>
|
<location filename="../../model/account/AccountManager.cpp" line="175"/>
|
||||||
<source>assistant_account_add_error</source>
|
<source>assistant_account_add_error</source>
|
||||||
<extracomment>"Unable to add account."</extracomment>
|
<extracomment>"Unable to add account."</extracomment>
|
||||||
<translation>Unable to add account.</translation>
|
<translation>Unable to add account.</translation>
|
||||||
|
|
|
||||||
|
|
@ -104,43 +104,43 @@
|
||||||
<context>
|
<context>
|
||||||
<name>AccountManager</name>
|
<name>AccountManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="88"/>
|
<location filename="../../model/account/AccountManager.cpp" line="93"/>
|
||||||
<source>assistant_account_login_already_connected_error</source>
|
<source>assistant_account_login_already_connected_error</source>
|
||||||
<extracomment>"The account is already connected"</extracomment>
|
<extracomment>"The account is already connected"</extracomment>
|
||||||
<translation>Le compte est déjà connecté</translation>
|
<translation>Le compte est déjà connecté</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="110"/>
|
<location filename="../../model/account/AccountManager.cpp" line="115"/>
|
||||||
<source>assistant_account_login_proxy_address_error</source>
|
<source>assistant_account_login_proxy_address_error</source>
|
||||||
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
||||||
<translation>Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine.</translation>
|
<translation>Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="123"/>
|
<location filename="../../model/account/AccountManager.cpp" line="128"/>
|
||||||
<source>assistant_account_login_address_configuration_error</source>
|
<source>assistant_account_login_address_configuration_error</source>
|
||||||
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
||||||
<translation>Impossible de configurer l'adresse : `%1`.</translation>
|
<translation>Impossible de configurer l'adresse : `%1`.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="130"/>
|
<location filename="../../model/account/AccountManager.cpp" line="135"/>
|
||||||
<source>assistant_account_login_params_configuration_error</source>
|
<source>assistant_account_login_params_configuration_error</source>
|
||||||
<extracomment>"Unable to configure account settings."</extracomment>
|
<extracomment>"Unable to configure account settings."</extracomment>
|
||||||
<translation>Impossible de configurer les paramètres du compte.</translation>
|
<translation>Impossible de configurer les paramètres du compte.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="154"/>
|
<location filename="../../model/account/AccountManager.cpp" line="159"/>
|
||||||
<source>assistant_account_login_forbidden_error</source>
|
<source>assistant_account_login_forbidden_error</source>
|
||||||
<extracomment>"Username and password do not match"</extracomment>
|
<extracomment>"Username and password do not match"</extracomment>
|
||||||
<translation>Le couple identifiant mot de passe ne correspond pas</translation>
|
<translation>Le couple identifiant mot de passe ne correspond pas</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="156"/>
|
<location filename="../../model/account/AccountManager.cpp" line="161"/>
|
||||||
<source>assistant_account_login_error</source>
|
<source>assistant_account_login_error</source>
|
||||||
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
||||||
<translation>Erreur durant la connexion, veuillez vérifier vos paramètres</translation>
|
<translation>Erreur durant la connexion, veuillez vérifier vos paramètres</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="170"/>
|
<location filename="../../model/account/AccountManager.cpp" line="175"/>
|
||||||
<source>assistant_account_add_error</source>
|
<source>assistant_account_add_error</source>
|
||||||
<extracomment>"Unable to add account."</extracomment>
|
<extracomment>"Unable to add account."</extracomment>
|
||||||
<translation>Impossible d'ajouter le compte.</translation>
|
<translation>Impossible d'ajouter le compte.</translation>
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ bool AccountManager::login(QString username,
|
||||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
auto core = CoreModel::getInstance()->getCore();
|
auto core = CoreModel::getInstance()->getCore();
|
||||||
auto factory = linphone::Factory::get();
|
auto factory = linphone::Factory::get();
|
||||||
QString assistantFile = (!QString::compare(domain, "sip.linphone.org") || domain.isEmpty())
|
QString assistantFile = (!QString::compare(domain, "sip.linphone.org", Qt::CaseInsensitive) || domain.isEmpty())
|
||||||
? "use-app-sip-account.rc"
|
? "use-app-sip-account.rc"
|
||||||
: "use-other-sip-account.rc";
|
: "use-other-sip-account.rc";
|
||||||
auto account = createAccount(assistantFile);
|
auto account = createAccount(assistantFile);
|
||||||
|
|
@ -82,8 +82,13 @@ bool AccountManager::login(QString username,
|
||||||
auto otherAccounts = core->getAccountList();
|
auto otherAccounts = core->getAccountList();
|
||||||
for (auto otherAccount : otherAccounts) {
|
for (auto otherAccount : otherAccounts) {
|
||||||
auto otherParams = otherAccount->getParams();
|
auto otherParams = otherAccount->getParams();
|
||||||
if (otherParams->getIdentityAddress()->getUsername() == Utils::appStringToCoreString(username) &&
|
if (domain.isEmpty()) {
|
||||||
otherParams->getDomain() == Utils::appStringToCoreString(domain)) {
|
lDebug() << "domain is empty, setting \"sip.linphone.org\" by default";
|
||||||
|
domain = "sip.linphone.org";
|
||||||
|
}
|
||||||
|
if (!QString::compare(Utils::coreStringToAppString(otherParams->getIdentityAddress()->getUsername()), username,
|
||||||
|
Qt::CaseInsensitive) &&
|
||||||
|
!QString::compare(Utils::coreStringToAppString(otherParams->getDomain()), domain, Qt::CaseInsensitive)) {
|
||||||
//: "The account is already connected"
|
//: "The account is already connected"
|
||||||
*errorMessage = tr("assistant_account_login_already_connected_error");
|
*errorMessage = tr("assistant_account_login_already_connected_error");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue