|
|
@ -454,8 +454,8 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|
|
|
NSMutableArray<SignalRecipient *> *recipients = [NSMutableArray new];
|
|
|
|
NSMutableArray<SignalRecipient *> *recipients = [NSMutableArray new];
|
|
|
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
for (NSString *recipientId in recipientIds) {
|
|
|
|
for (NSString *recipientId in recipientIds) {
|
|
|
|
SignalRecipient *recipient =
|
|
|
|
SignalRecipient *recipient = [SignalRecipient getOrCreatedUnsavedRecipientForRecipientId:recipientId
|
|
|
|
[SignalRecipient ensureRecipientExistsWithRecipientId:recipientId transaction:transaction];
|
|
|
|
transaction:transaction];
|
|
|
|
[recipients addObject:recipient];
|
|
|
|
[recipients addObject:recipient];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
}];
|
|
|
@ -555,11 +555,10 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
__block SignalRecipient *recipient;
|
|
|
|
NSArray<SignalRecipient *> *recipients =
|
|
|
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
[self signalRecipientsForRecipientIds:@[recipientContactId] message:message];
|
|
|
|
recipient =
|
|
|
|
OWSAssert(recipients.count == 1);
|
|
|
|
[SignalRecipient ensureRecipientExistsWithRecipientId:recipientContactId transaction:transaction];
|
|
|
|
SignalRecipient *recipient = recipients.firstObject;
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!recipient) {
|
|
|
|
if (!recipient) {
|
|
|
|
NSError *error = OWSErrorMakeFailedToSendOutgoingMessageError();
|
|
|
|
NSError *error = OWSErrorMakeFailedToSendOutgoingMessageError();
|
|
|
|