mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-02 12:19:23 +00:00
feat(AssistantModel): if no xmlrpc_uri given in login, use addOtherSipAccount directly
This commit is contained in:
parent
6de72ed5bd
commit
7282504f56
10 changed files with 55 additions and 3 deletions
|
|
@ -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'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`.")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue