Deactivated account is no longer a logout and is just related to registration: Keep background activities and avoid requesting passwords.

This commit is contained in:
Julien Wadel 2025-08-20 09:58:34 +02:00
parent 1e34883610
commit 3071729bac
3 changed files with 18 additions and 5 deletions

View file

@ -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

View file

@ -331,6 +331,7 @@ void AccountSettingsModel::removeAccount (const shared_ptr<linphone::Account> &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<linphone::Account> 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<linphone::Account> 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

View file

@ -106,6 +106,7 @@ public:
);
Q_INVOKABLE void eraseAllPasswords ();
void clearAuthInfo(std::shared_ptr<linphone::Account> account, bool delay);
signals: