Don't create identity change methods for brand new contacts.

This commit is contained in:
Greyson Parrelli 2020-05-20 17:10:14 -04:00 committed by Alex Hart
parent dc7c54a1f8
commit bb6ca80d5a

View File

@ -146,6 +146,7 @@ public class IdentityDatabase extends Database {
}
public void updateIdentityAfterSync(@NonNull RecipientId id, IdentityKey identityKey, VerifiedStatus verifiedStatus) {
boolean hadEntry = getIdentity(id).isPresent();
boolean keyMatches = hasMatchingKey(id, identityKey);
boolean statusMatches = keyMatches && hasMatchingStatus(id, identityKey, verifiedStatus);
@ -155,7 +156,7 @@ public class IdentityDatabase extends Database {
if (record.isPresent()) EventBus.getDefault().post(record.get());
}
if (!keyMatches) {
if (hadEntry && !keyMatches) {
IdentityUtil.markIdentityUpdate(context, id);
}
}