Merge branch 'charlesmchen/contactsVsConcurrency'

pull/1/head
Matthew Chen 7 years ago
commit 77fd69c4e3

@ -53,19 +53,27 @@ NS_ASSUME_NONNULL_BEGIN
{ {
if (identifiers.count < 1) { if (identifiers.count < 1) {
OWSFail(@"%@ Cannot lookup zero identifiers", self.logTag); OWSFail(@"%@ Cannot lookup zero identifiers", self.logTag);
failure(OWSErrorWithCodeDescription(OWSErrorCodeInvalidMethodParameters, @"Cannot lookup zero identifiers")); DispatchMainThreadSafe(^{
failure(
OWSErrorWithCodeDescription(OWSErrorCodeInvalidMethodParameters, @"Cannot lookup zero identifiers"));
});
return; return;
} }
[self contactIntersectionWithSet:[NSSet setWithArray:identifiers] [self contactIntersectionWithSet:[NSSet setWithArray:identifiers]
success:^(NSSet<SignalRecipient *> *recipients) { success:^(NSSet<SignalRecipient *> *recipients) {
if (recipients.count == 0) { if (recipients.count == 0) {
DDLogInfo( DDLogInfo(@"%@ in %s no contacts are Signal users", self.logTag, __PRETTY_FUNCTION__);
@"%@ in %s no contacts are Signal users", self.logTag, __PRETTY_FUNCTION__); }
} DispatchMainThreadSafe(^{
success(recipients.allObjects); success(recipients.allObjects);
} });
failure:failure]; }
failure:^(NSError *error) {
DispatchMainThreadSafe(^{
failure(error);
});
}];
} }
- (void)contactIntersectionWithSet:(NSSet<NSString *> *)recipientIdsToLookup - (void)contactIntersectionWithSet:(NSSet<NSString *> *)recipientIdsToLookup

Loading…
Cancel
Save