Preserve UNVERIFIED status on key change

Don't revert it to default, which would effectively downgrade the security model
for that contact.

// FREEBIE
This commit is contained in:
lilia 2017-06-14 12:09:28 -07:00 committed by Scott Nonnenberg
parent 12d9bb61c3
commit aa6dbb2e59

View file

@ -431,8 +431,10 @@
});
} else if (!equalArrayBuffers(oldpublicKey, publicKey)) {
console.log("Replacing existing identity...");
var previousStatus = identityKey.get('verified');
var verifiedStatus;
if (identityKey.get('verified') === VerifiedStatus.VERIFIED) {
if (previousStatus === VerifiedStatus.VERIFIED
|| previousStatus === VerifiedStatus.UNVERIFIED) {
verifiedStatus = VerifiedStatus.UNVERIFIED;
} else {
verifiedStatus = VerifiedStatus.DEFAULT;