From bfbafab84b84402d2ac9177e44722d8b77acd711 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 17 Nov 2025 17:45:20 +0100 Subject: [PATCH] fix verification when trying to connect to an account that is already connected --- Linphone/data/languages/de.ts | 14 +++++++------- Linphone/data/languages/en.ts | 14 +++++++------- Linphone/data/languages/fr.ts | 14 +++++++------- Linphone/model/account/AccountManager.cpp | 11 ++++++++--- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index b79517892..23cc870a6 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -104,43 +104,43 @@ AccountManager - + assistant_account_login_already_connected_error "The account is already connected" Das Konto ist bereits verbunden - + 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_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 75fea3cea..d73c3dc56 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -104,43 +104,43 @@ AccountManager - + assistant_account_login_already_connected_error "The account is already connected" The account is already connected - + 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_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 8f4907ad2..b7e40b5dc 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -104,43 +104,43 @@ AccountManager - + assistant_account_login_already_connected_error "The account is already connected" Le compte est déjà connecté - + 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_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 4d8911e3f..9649150f5 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -67,7 +67,7 @@ bool AccountManager::login(QString username, mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); auto core = CoreModel::getInstance()->getCore(); 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-other-sip-account.rc"; auto account = createAccount(assistantFile); @@ -82,8 +82,13 @@ bool AccountManager::login(QString username, auto otherAccounts = core->getAccountList(); for (auto otherAccount : otherAccounts) { auto otherParams = otherAccount->getParams(); - if (otherParams->getIdentityAddress()->getUsername() == Utils::appStringToCoreString(username) && - otherParams->getDomain() == Utils::appStringToCoreString(domain)) { + if (domain.isEmpty()) { + 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" *errorMessage = tr("assistant_account_login_already_connected_error"); return false;