Don't post extraneous verified change notification

This commit is contained in:
Fedor Indutny 2022-04-25 13:54:13 -07:00 committed by GitHub
parent 5e0534310e
commit fd610a6300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -2659,17 +2659,17 @@ export class ConversationModel extends window.Backbone
} }
} }
const didSomethingChange = keyChange || beginningVerified !== verified; const didVerifiedChange = beginningVerified !== verified;
const isExplicitUserAction = !options.viaStorageServiceSync; const isExplicitUserAction = !options.viaStorageServiceSync;
const shouldShowFromStorageSync = const shouldShowFromStorageSync =
options.viaStorageServiceSync && verified !== UNVERIFIED; options.viaStorageServiceSync && verified !== UNVERIFIED;
if ( if (
// The message came from an explicit verification in a client (not a contact sync // The message came from an explicit verification in a client (not
// or storage service sync) // storage service sync)
(didSomethingChange && isExplicitUserAction) || (didVerifiedChange && isExplicitUserAction) ||
// The verification value received by the contact sync is different from what we // The verification value received by the storage sync is different from what we
// have on record (and it's not a transition to UNVERIFIED) // have on record (and it's not a transition to UNVERIFIED)
(didSomethingChange && shouldShowFromStorageSync) || (didVerifiedChange && shouldShowFromStorageSync) ||
// Our local verification status is VERIFIED and it hasn't changed, but the key did // Our local verification status is VERIFIED and it hasn't changed, but the key did
// change (Key1/VERIFIED -> Key2/VERIFIED), but we don't want to show DEFAULT -> // change (Key1/VERIFIED -> Key2/VERIFIED), but we don't want to show DEFAULT ->
// DEFAULT or UNVERIFIED -> UNVERIFIED // DEFAULT or UNVERIFIED -> UNVERIFIED