Skip to content
Snippets Groups Projects
Commit c48e533b authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

newaccountmodel: check if credentials changed before setting

GitLab: jami-libclient#376
Change-Id: If05aac4a99b06148467c82221ec3bd27edfd3bf6
parent 32159b20
Branches
No related tags found
No related merge requests found
...@@ -270,6 +270,11 @@ AccountModel::setAccountConfig(const QString& accountId, ...@@ -270,6 +270,11 @@ AccountModel::setAccountConfig(const QString& accountId,
finalCred.append(credMap); finalCred.append(credMap);
} }
VectorMapStringString oldCredentials = ConfigurationManager::instance().getCredentials(accountId);
if (oldCredentials.empty() || finalCred.empty() ||
oldCredentials[0][ConfProperties::PASSWORD] != finalCred[0][ConfProperties::PASSWORD] ||
oldCredentials[0][ConfProperties::REALM] != finalCred[0][ConfProperties::REALM] ||
oldCredentials[0][ConfProperties::USERNAME] != finalCred[0][ConfProperties::USERNAME])
ConfigurationManager::instance().setCredentials(accountId, finalCred); ConfigurationManager::instance().setCredentials(accountId, finalCred);
details[ConfProperties::USERNAME] = confProperties.username; details[ConfProperties::USERNAME] = confProperties.username;
accountInfo.confProperties.credentials.swap(credentialsVec); accountInfo.confProperties.credentials.swap(credentialsVec);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment