Clean up ahead of PR.
// FREEBIE
This commit is contained in:
parent
f1d85c2a95
commit
d9acaced2a
@ -29,6 +29,7 @@ extern NSString *const kNSNotificationName_IdentityStateDidChange;
|
||||
- (BOOL)isCurrentIdentityTrustedForSendingWithRecipientId:(NSString *)recipientId;
|
||||
|
||||
- (void)generateNewIdentityKey;
|
||||
|
||||
- (nullable NSData *)identityKeyForRecipientId:(NSString *)recipientId;
|
||||
|
||||
- (void)setVerificationState:(OWSVerificationState)verificationState
|
||||
@ -38,6 +39,13 @@ extern NSString *const kNSNotificationName_IdentityStateDidChange;
|
||||
|
||||
- (OWSVerificationState)verificationStateForRecipientId:(NSString *)recipientId;
|
||||
|
||||
/**
|
||||
* @param recipientId unique stable identifier for the recipient, e.g. e164 phone number
|
||||
* @returns nil if the recipient does not exist, or if the recipient exists and is OWSVerificationStateVerified or
|
||||
* OWSVerificationStateDefault else return the no longer verified identity
|
||||
*/
|
||||
- (OWSRecipientIdentity *)noLongerVerifiedIdentityForRecipientId:(NSString *)recipientId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -235,6 +235,21 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
||||
}
|
||||
}
|
||||
|
||||
- (OWSRecipientIdentity *)noLongerVerifiedIdentityForRecipientId:(NSString *)recipientId
|
||||
{
|
||||
OWSAssert(recipientId.length > 0);
|
||||
|
||||
@synchronized(self)
|
||||
{
|
||||
OWSRecipientIdentity *_Nullable identity = [OWSRecipientIdentity fetchObjectWithUniqueID:recipientId];
|
||||
|
||||
if (identity && identity.verificationState == OWSVerificationStateNoLongerVerified) {
|
||||
return identity;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)fireIdentityStateChangeNotification
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user