Commit ca0b8dcc authored by Finn Herzfeld's avatar Finn Herzfeld 🌵

save after successful dedup

parent ae7e8e4d
Pipeline #4063 passed with stages
in 9 minutes and 44 seconds
......@@ -109,12 +109,14 @@ public class AccountData {
axolotlStore.identityKeyStore.setResolver(getResolver());
}
private void update() {
private void update() throws IOException {
if(address == null) {
address = new JsonAddress(username);
}
axolotlStore.sessionStore.resolveAll();
axolotlStore.identityKeyStore.dedup();
if(axolotlStore.identityKeyStore.dedup()) {
save();
}
}
public void save() throws IOException {
......
......@@ -173,7 +173,7 @@ public class IdentityKeyStore implements org.whispersystems.libsignal.state.Iden
return maxIdentity.getKey();
}
public void dedup() {
public boolean dedup() {
List<Identity> duplicates = new ArrayList<>();
// this is a hell of a lot of nested loops...
......@@ -195,6 +195,8 @@ public class IdentityKeyStore implements org.whispersystems.libsignal.state.Iden
logger.warn("Found duplicate identity key with address " + dup.address.toRedactedString());
trustedKeys.remove(dup);
}
return duplicates.size() > 0;
}
@JsonIgnore
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment