From 2c49232db027c201dcd7a891b229f8c7dbb149cb Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 10 Sep 2018 17:56:18 -0500 Subject: [PATCH] remove barely used getters Lock contention on these methods is less important because we're not iterating over their access, e.g. per tableViewCell --- .../AppSettings/BlockListViewController.m | 9 +++++++-- SignalMessaging/Views/ContactsViewHelper.h | 4 ---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Signal/src/ViewControllers/AppSettings/BlockListViewController.m b/Signal/src/ViewControllers/AppSettings/BlockListViewController.m index 733f00176..e7f478c79 100644 --- a/Signal/src/ViewControllers/AppSettings/BlockListViewController.m +++ b/Signal/src/ViewControllers/AppSettings/BlockListViewController.m @@ -30,6 +30,11 @@ NS_ASSUME_NONNULL_BEGIN @implementation BlockListViewController +- (OWSBlockingManager *)blockingManager +{ + return OWSBlockingManager.sharedManager; +} + - (void)loadView { [super loadView]; @@ -77,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN // "Blocklist" section NSArray *blockedPhoneNumbers = - [helper.blockedPhoneNumbers sortedArrayUsingSelector:@selector(compare:)]; + [self.blockingManager.blockedPhoneNumbers sortedArrayUsingSelector:@selector(compare:)]; if (blockedPhoneNumbers.count > 0) { OWSTableSection *blockedContactsSection = [OWSTableSection new]; @@ -104,7 +109,7 @@ NS_ASSUME_NONNULL_BEGIN [contents addSection:blockedContactsSection]; } - NSArray *blockedGroupIds = helper.blockedGroupIds; + NSArray *blockedGroupIds = self.blockingManager.blockedGroupIds; if (blockedGroupIds.count > 0) { OWSTableSection *blockedGroupsSection = [OWSTableSection new]; blockedGroupsSection.headerTitle = NSLocalizedString( diff --git a/SignalMessaging/Views/ContactsViewHelper.h b/SignalMessaging/Views/ContactsViewHelper.h index 3fd412509..2e3483690 100644 --- a/SignalMessaging/Views/ContactsViewHelper.h +++ b/SignalMessaging/Views/ContactsViewHelper.h @@ -46,9 +46,6 @@ NS_ASSUME_NONNULL_BEGIN // Useful to differentiate between having no signal accounts vs. haven't checked yet @property (nonatomic, readonly) BOOL hasUpdatedContactsAtLeastOnce; -@property (nonatomic, readonly) NSArray *blockedPhoneNumbers; -@property (nonatomic, readonly) NSArray *blockedGroupIds; - // Suitable when the user tries to perform an action which is not possible due to the user having // previously denied contact access. - (void)presentMissingContactAccessAlertControllerFromViewController:(UIViewController *)viewController; @@ -60,7 +57,6 @@ NS_ASSUME_NONNULL_BEGIN - (nullable SignalAccount *)fetchSignalAccountForRecipientId:(NSString *)recipientId; - (SignalAccount *)fetchOrBuildSignalAccountForRecipientId:(NSString *)recipientId; -// MJK TODO Can we remove? // This method is faster than OWSBlockingManager but // is only safe to be called on the main thread. - (BOOL)isRecipientIdBlocked:(NSString *)recipientId;