From 3071729bacd57217c09e11ad986f26c072839e18 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 20 Aug 2025 09:58:34 +0200 Subject: [PATCH] Deactivated account is no longer a logout and is just related to registration: Keep background activities and avoid requesting passwords. --- CHANGELOG.md | 1 + .../settings/AccountSettingsModel.cpp | 21 ++++++++++++++----- .../settings/AccountSettingsModel.hpp | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 729ed30fc..0e0c50879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Screen Sharing +- Deactivated account is no longer a logout and is just related to registration: Keep background activities and avoid requesting passwords. ## 5.2.6 - 2024-07-22 diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index 79bba2c8d..74ed71f30 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -331,6 +331,7 @@ void AccountSettingsModel::removeAccount (const shared_ptr &a mRemovingAccounts.push_back(account); }else{// Registration is not enabled : Removing without wait. CoreManager::getInstance()->getCore()->removeAccount(account); + clearAuthInfo(account, false); } emit accountSettingsUpdated(); @@ -520,6 +521,19 @@ void AccountSettingsModel::addAuthInfo ( CoreManager::getInstance()->getCore()->addAuthInfo(authInfo); } +void AccountSettingsModel::clearAuthInfo(std::shared_ptr account, bool delay) { + if (account) { + auto authInfo = account->findAuthInfo(); + if(authInfo) + if ( delay) + QTimer::singleShot(60000, [authInfo](){// 60s is just to be sure. account_update remove deleted account only after 32s + CoreManager::getInstance()->getCore()->removeAuthInfo(authInfo); + }); + else + CoreManager::getInstance()->getCore()->removeAuthInfo(authInfo); + } +} + void AccountSettingsModel::eraseAllPasswords () { CoreManager::getInstance()->getCore()->clearAllAuthInfo(); } @@ -648,11 +662,8 @@ void AccountSettingsModel::handleRegistrationStateChanged ( auto coreManager = CoreManager::getInstance(); shared_ptr defaultAccount = coreManager->getCore()->getDefaultAccount(); if( state == linphone::RegistrationState::Cleared){ - auto authInfo = account->findAuthInfo(); - if(authInfo) - QTimer::singleShot(60000, [authInfo](){// 60s is just to be sure. account_update remove deleted account only after 32s - CoreManager::getInstance()->getCore()->removeAuthInfo(authInfo); - }); + if (!findAccount(account->getContactAddress())) + clearAuthInfo(account, true); }else if(mRemovingAccounts.contains(account)){ mRemovingAccounts.removeAll(account); QTimer::singleShot(100, [account, this](){// removeAccount cannot be called from callback diff --git a/linphone-app/src/components/settings/AccountSettingsModel.hpp b/linphone-app/src/components/settings/AccountSettingsModel.hpp index e523b487c..af06430e9 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.hpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.hpp @@ -106,6 +106,7 @@ public: ); Q_INVOKABLE void eraseAllPasswords (); + void clearAuthInfo(std::shared_ptr account, bool delay); signals: