Respond to "sync block list" request.

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

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

@ -225,6 +225,15 @@ NSString *const kOWSBlockingManager_SyncedBlockedPhoneNumbersKey = @"kOWSBlockin
[self observeNotifications]; [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. // This method should only be called from within a synchronized block.
- (void)syncBlockedPhoneNumbersIfNecessary - (void)syncBlockedPhoneNumbersIfNecessary
{ {

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

Loading…
Cancel
Save