Respond to "sync block list" request.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 4e30ec1aef
commit a31b1aeea6

@ -25,6 +25,8 @@ extern NSString *const kNSNotificationName_BlockedPhoneNumbersDidChange;
- (BOOL)isRecipientIdBlocked:(NSString *)recipientId;
- (void)syncBlockedPhoneNumbers;
@end
NS_ASSUME_NONNULL_END

@ -225,6 +225,15 @@ NSString *const kOWSBlockingManager_SyncedBlockedPhoneNumbersKey = @"kOWSBlockin
[self observeNotifications];
}
- (void)syncBlockedPhoneNumbers
{
OWSAssert(_blockedPhoneNumberSet);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self sendBlockedPhoneNumbersMessage:self.blockedPhoneNumbers];
});
}
// This method should only be called from within a synchronized block.
- (void)syncBlockedPhoneNumbersIfNecessary
{

@ -602,8 +602,8 @@ NS_ASSUME_NONNULL_BEGIN
DDLogError(@"%@ Failed to send Groups response syncMessage with error: %@", self.tag, error);
}];
} else if (syncMessage.request.type == OWSSignalServiceProtosSyncMessageRequestTypeBlocked) {
// TODO
DDLogWarn(@"%@ Received unsupported request for block list", self.tag);
DDLogInfo(@"%@ Received request for block list", self.tag);
[_blockingManager syncBlockedPhoneNumbers];
} else if (syncMessage.request.type == OWSSignalServiceProtosSyncMessageRequestTypeConfiguration) {
BOOL areReadReceiptsEnabled =
[[OWSReadReceiptManager sharedManager] areReadReceiptsEnabledWithTransaction:transaction];

Loading…
Cancel
Save