From 6ed9f87963211b9c2e69bc3a52a31dcf1abf16c6 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 7 Jan 2025 15:53:19 +0100 Subject: [PATCH] Fix voicemail url in settings. Fix #LINQT-1479 --- Linphone/core/account/AccountCore.cpp | 36 ++++++++++++++++++--------- Linphone/core/account/AccountCore.hpp | 1 + 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index 6c9b7277..f7fbcdfc 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -125,6 +125,7 @@ AccountCore::AccountCore(const AccountCore &accountCore) { mDevices = accountCore.mDevices; mNotificationsAllowed = accountCore.mNotificationsAllowed; mMwiServerAddress = accountCore.mMwiServerAddress; + mVoicemailAddress = accountCore.mVoicemailAddress; mTransport = accountCore.mTransport; mTransports = accountCore.mTransports; mServerAddress = accountCore.mServerAddress; @@ -180,6 +181,9 @@ void AccountCore::setSelf(QSharedPointer me) { mAccountModelConnection->makeConnectToModel(&AccountModel::mwiServerAddressChanged, [this](QString value) { mAccountModelConnection->invokeToCore([this, value]() { onMwiServerAddressChanged(value); }); }); + mAccountModelConnection->makeConnectToModel(&AccountModel::voicemailAddressChanged, [this](QString value) { + mAccountModelConnection->invokeToCore([this, value]() { onVoicemailAddressChanged(value); }); + }); mAccountModelConnection->makeConnectToModel(&AccountModel::transportChanged, [this](linphone::TransportType value) { mAccountModelConnection->invokeToCore( [this, value]() { onTransportChanged(LinphoneEnums::toString(LinphoneEnums::fromLinphone(value))); }); @@ -274,6 +278,7 @@ void AccountCore::reset(const AccountCore &accountCore) { setUnreadCallNotifications(accountCore.mUnreadCallNotifications); setUnreadMessageNotifications(accountCore.mUnreadMessageNotifications); setMwiServerAddress(accountCore.mMwiServerAddress); + setVoicemailAddress(accountCore.mVoicemailAddress); setTransport(accountCore.mTransport); setServerAddress(accountCore.mServerAddress); setOutboundProxyEnabled(accountCore.mOutboundProxyEnabled); @@ -448,6 +453,10 @@ QString AccountCore::getMwiServerAddress() { return mMwiServerAddress; } +QString AccountCore::getVoicemailAddress() { + return mVoicemailAddress; +} + QStringList AccountCore::getTransports() { return mTransports; } @@ -496,10 +505,6 @@ QString AccountCore::getLimeServerUrl() { return mLimeServerUrl; } -QString AccountCore::getVoicemailAddress() { - return mVoicemailAddress; -} - void AccountCore::setMwiServerAddress(QString value) { if (mMwiServerAddress != value) { mMwiServerAddress = value; @@ -508,6 +513,14 @@ void AccountCore::setMwiServerAddress(QString value) { } } +void AccountCore::setVoicemailAddress(QString value) { + if (mVoicemailAddress != value) { + mVoicemailAddress = value; + emit voicemailAddressChanged(); + setIsSaved(false); + } +} + void AccountCore::setTransport(QString value) { if (mTransport != value) { mTransport = value; @@ -596,14 +609,6 @@ void AccountCore::setLimeServerUrl(QString value) { } } -void AccountCore::setVoicemailAddress(QString value) { - if (mVoicemailAddress != value) { - mVoicemailAddress = value; - emit voicemailAddressChanged(); - setIsSaved(false); - } -} - bool AccountCore::isSaved() const { return mIsSaved; } @@ -629,6 +634,13 @@ void AccountCore::onMwiServerAddressChanged(QString value) { } } +void AccountCore::onVoicemailAddressChanged(QString value) { + if (value != mVoicemailAddress) { + mVoicemailAddress = value; + emit voicemailAddressChanged(); + } +} + void AccountCore::onTransportChanged(QString value) { if (value != mTransport) { mTransport = value; diff --git a/Linphone/core/account/AccountCore.hpp b/Linphone/core/account/AccountCore.hpp index 1f0b6c1c..0cf824a0 100644 --- a/Linphone/core/account/AccountCore.hpp +++ b/Linphone/core/account/AccountCore.hpp @@ -152,6 +152,7 @@ public: void onNotificationsAllowedChanged(bool value); void onMwiServerAddressChanged(QString value); + void onVoicemailAddressChanged(QString value); void onTransportChanged(QString value); void onServerAddressChanged(QString value); void onOutboundProxyEnabledChanged(bool value);