|
|
|
@ -495,11 +495,9 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
|
|
|
|
[messages addObject:message];
|
|
|
|
|
}
|
|
|
|
|
if (messages.count > 0) {
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
for (OWSVerificationStateSyncMessage *message in messages) {
|
|
|
|
|
[self sendSyncVerificationStateMessage:message];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -509,7 +507,6 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
|
|
|
|
{
|
|
|
|
|
OWSAssert(message);
|
|
|
|
|
OWSAssert(message.verificationForRecipientId.length > 0);
|
|
|
|
|
OWSAssert([NSThread isMainThread]);
|
|
|
|
|
|
|
|
|
|
TSContactThread *contactThread = [TSContactThread getOrCreateThreadWithContactId:message.verificationForRecipientId];
|
|
|
|
|
|
|
|
|
@ -519,7 +516,6 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
|
|
|
|
verificationStateSyncMessage:message];
|
|
|
|
|
[self.messageSender sendMessage:nullMessage
|
|
|
|
|
success:^{
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
DDLogInfo(@"%@ Successfully sent verification state NullMessage", self.tag);
|
|
|
|
|
[self.messageSender sendMessage:message
|
|
|
|
|
success:^{
|
|
|
|
@ -529,10 +525,8 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
|
|
|
|
[self clearSyncMessageForRecipientId:message.verificationForRecipientId];
|
|
|
|
|
}
|
|
|
|
|
failure:^(NSError *error) {
|
|
|
|
|
DDLogError(
|
|
|
|
|
@"%@ Failed to send verification state sync message with error: %@", self.tag, error);
|
|
|
|
|
DDLogError(@"%@ Failed to send verification state sync message with error: %@", self.tag, error);
|
|
|
|
|
}];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
failure:^(NSError *_Nonnull error) {
|
|
|
|
|
DDLogError(@"%@ Failed to send verification state NullMessage with error: %@", self.tag, error);
|
|
|
|
@ -575,6 +569,7 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
|
|
|
|
}
|
|
|
|
|
NSData *identityKey = [rawIdentityKey removeKeyType];
|
|
|
|
|
|
|
|
|
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
switch (verified.state) {
|
|
|
|
|
case OWSSignalServiceProtosVerifiedStateDefault:
|
|
|
|
|
[self tryToApplyVerificationStateFromSyncMessage:OWSVerificationStateDefault
|
|
|
|
@ -595,6 +590,7 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
[self fireIdentityStateChangeNotification];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)tryToApplyVerificationStateFromSyncMessage:(OWSVerificationState)verificationState
|
|
|
|
|