diff --git a/SignalServiceKit/src/Messages/OWSMessageSender.m b/SignalServiceKit/src/Messages/OWSMessageSender.m index 93069f440..2bcc5e3a9 100644 --- a/SignalServiceKit/src/Messages/OWSMessageSender.m +++ b/SignalServiceKit/src/Messages/OWSMessageSender.m @@ -365,15 +365,13 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; [NSNotificationCenter.defaultCenter postNotificationName:NSNotification.calculatingPoW object:[[NSNumber alloc] initWithUnsignedLongLong:message.timestamp]]; } - dispatch_async(dispatch_get_main_queue(), ^{ - if ([LKFriendRequestProtocol shouldUpdateFriendRequestStatusFromMessage:message]) { - [self.primaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { - // Loki: Optimistically update friend request status when we can. This is used for - // e.g. preventing AFRs from being sent twice on a contact sync. - [LKFriendRequestProtocol setFriendRequestStatusToSendingIfNeededForHexEncodedPublicKey:message.thread.contactIdentifier transaction:transaction]; - }]; - } - }); + if ([LKFriendRequestProtocol shouldUpdateFriendRequestStatusFromMessage:message]) { + [self.primaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + // Loki: Optimistically update friend request status when we can. This is used for + // e.g. preventing AFRs from being sent twice on a contact sync. + [LKFriendRequestProtocol setFriendRequestStatusToSendingIfNeededForHexEncodedPublicKey:message.thread.contactIdentifier transaction:transaction]; + }]; + } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSMutableArray *allAttachmentIds = [NSMutableArray new];