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
No related branches found
No related tags found
No related merge requests found
......@@ -270,7 +270,12 @@ AccountModel::setAccountConfig(const QString& accountId,
finalCred.append(credMap);
}
ConfigurationManager::instance().setCredentials(accountId, finalCred);
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);
details[ConfProperties::USERNAME] = confProperties.username;
accountInfo.confProperties.credentials.swap(credentialsVec);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment