Change identity password on changing account password for same tld

This commit is contained in:
M66B
2019-09-01 19:42:52 +02:00
parent 72214f2884
commit c89dd5a979
2 changed files with 19 additions and 0 deletions

View File

@@ -930,6 +930,17 @@ public class FragmentAccount extends FragmentBase {
try {
db.beginTransaction();
if (account != null && !account.password.equals(password)) {
List<EntityIdentity> identities = db.identity().getIdentities(account.id);
for (EntityIdentity identity : identities)
if (identity.password.equals(account.password) &&
Helper.getTld(identity.host).equals(Helper.getTld(account.host))) {
Log.i("Changing identity password host=" + identity.host);
identity.password = password;
db.identity().updateIdentity(identity);
}
}
boolean update = (account != null);
if (account == null)
account = new EntityAccount();