From ac41881e1106716ac2ab9e191d10c95214a0a85e Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 28 Aug 2025 11:50:40 +0200 Subject: [PATCH] Publish presence indicator synchronized on default account. On account update, send in queue the publishChanged event to let time for SDK to make update consolidated presence. Add missing offline status. --- CHANGELOG.md | 1 + linphone-app/src/components/presence/OwnPresenceModel.cpp | 4 ++-- linphone-app/src/components/settings/AccountSettingsModel.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d645a16e..8de3a1af5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Avoid to register the account while activating it. - Volumes settings based on hardware volumes. Remove software gains. - Display call duration instead of conference duration. +- Publish presence indicator synchronized on default account. ### Added - Screen Sharing in conference calls diff --git a/linphone-app/src/components/presence/OwnPresenceModel.cpp b/linphone-app/src/components/presence/OwnPresenceModel.cpp index b6e6a0d5a..14349a1bc 100644 --- a/linphone-app/src/components/presence/OwnPresenceModel.cpp +++ b/linphone-app/src/components/presence/OwnPresenceModel.cpp @@ -37,7 +37,7 @@ OwnPresenceModel::OwnPresenceModel (QObject *parent) : QObject(parent) { Presence::PresenceStatus status = static_cast(CoreManager::getInstance()->getCore()->getConsolidatedPresence()); emit presenceStatusChanged(status); emit presenceLevelChanged(Presence::getPresenceLevel(status)); - }); + }, Qt::QueuedConnection); } Presence::PresenceLevel OwnPresenceModel::getPresenceLevel () const { @@ -75,7 +75,7 @@ QVariantList OwnPresenceModel::getStatuses () const { addBuildStatus(statuses, Presence::Online); addBuildStatus(statuses, Presence::Busy); //addBuildStatus(statuses, Presence::DoNotDisturb); // Do not propose this status as it is not fully supported - //addBuildStatus(statuses, Presence::Offline); // Do not propose this status as it is not fully supported + addBuildStatus(statuses, Presence::Offline); return statuses; } diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index 74ed71f30..8075ce125 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -76,6 +76,8 @@ AccountSettingsModel::AccountSettingsModel (QObject *parent) : QObject(parent) { QObject::connect(this, &AccountSettingsModel::accountSettingsUpdated, this, &AccountSettingsModel::accountsChanged); QObject::connect(this, &AccountSettingsModel::accountsChanged, this, &AccountSettingsModel::missedCallsCountChanged); QObject::connect(this, &AccountSettingsModel::accountsChanged, this, &AccountSettingsModel::unreadMessagesCountChanged); + QObject::connect(this, &AccountSettingsModel::defaultAccountChanged, this, &AccountSettingsModel::publishPresenceChanged); + mSelectedAccount = coreManager->getCore()->getDefaultAccount(); } @@ -425,7 +427,7 @@ bool AccountSettingsModel::addOrUpdateAccount( newPublishPresence = accountParams->publishEnabled() != data["publishPresence"].toBool(); accountParams->enablePublish(data["publishPresence"].toBool()); }else - newPublishPresence = accountParams->publishEnabled(); + newPublishPresence = true; if(data.contains("avpfEnabled")) accountParams->setAvpfMode(data["avpfEnabled"].toBool() ? linphone::AVPFMode::Enabled