Skip to content

Commit fde14fd

Browse files
committed
CORE-1198 rename more methods
1 parent c6442f9 commit fde14fd

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

Branch-SDK/BNCURLFilter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
- (NSString*_Nullable) patternMatchingURL:(NSURL*_Nullable)url;
3434

3535
/// Refreshes the list of ignored URLs from the server.
36-
- (void) refreshBlackListFromServerWithCompletion:(void (^_Nullable) (NSError*_Nullable error, NSArray*_Nullable list))completion;
36+
- (void) updatePatternListWithCompletion:(void (^_Nullable) (NSError*_Nullable error, NSArray*_Nullable list))completion;
3737

3838
/// Is YES if the listed has already been updated from the server.
39-
@property (assign, readonly) BOOL hasRefreshedBlackListFromServer;
40-
@property (strong) NSArray<NSString*>*_Nullable blackList;
39+
@property (assign, readonly) BOOL hasUpdatedPatternList;
40+
@property (strong) NSArray<NSString*>*_Nullable patternList;
4141
@end

Branch-SDK/BNCURLFilter.m

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ @interface BNCURLFilter () {
1717
@property (strong) NSArray<NSRegularExpression*> *ignoredURLRegex;
1818
@property (assign) NSInteger blackListVersion;
1919
@property (strong) id<BNCNetworkServiceProtocol> networkService;
20-
@property (assign) BOOL hasRefreshedBlackListFromServer;
20+
@property (assign) BOOL hasUpdatedPatternList;
2121
@property (strong) NSError *error;
2222
@property (strong) NSURL *blackListJSONURL;
2323
@end
@@ -28,7 +28,7 @@ - (instancetype) init {
2828
self = [super init];
2929
if (!self) return self;
3030

31-
self.blackList = @[
31+
self.patternList = @[
3232
@"^fb\\d+:",
3333
@"^li\\d+:",
3434
@"^pdk\\d+:",
@@ -41,12 +41,12 @@ - (instancetype) init {
4141

4242
NSArray *storedList = [BNCPreferenceHelper preferenceHelper].URLBlackList;
4343
if (storedList.count > 0) {
44-
self.blackList = storedList;
44+
self.patternList = storedList;
4545
self.blackListVersion = [BNCPreferenceHelper preferenceHelper].URLBlackListVersion;
4646
}
4747

4848
NSError *error = nil;
49-
_ignoredURLRegex = [self.class compileRegexArray:self.blackList error:&error];
49+
_ignoredURLRegex = [self.class compileRegexArray:self.patternList error:&error];
5050
self.error = error;
5151

5252
return self;
@@ -57,14 +57,14 @@ - (void) dealloc {
5757
self.networkService = nil;
5858
}
5959

60-
- (void) setBlackList:(NSArray<NSString *> *)blackList {
60+
- (void) setPatternList:(NSArray<NSString *> *)blackList {
6161
@synchronized (self) {
6262
_blackList = blackList;
6363
_ignoredURLRegex = [self.class compileRegexArray:_blackList error:nil];
6464
}
6565
}
6666

67-
- (NSArray<NSString*>*) blackList {
67+
- (NSArray<NSString*>*) patternList {
6868
@synchronized (self) {
6969
return _blackList;
7070
}
@@ -108,16 +108,16 @@ - (BOOL) shouldIgnoreURL:(NSURL *)url {
108108
}
109109

110110
- (void) refreshBlackListFromServer {
111-
[self refreshBlackListFromServerWithCompletion:nil];
111+
[self updatePatternListWithCompletion:nil];
112112
}
113113

114-
- (void) refreshBlackListFromServerWithCompletion:(void (^) (NSError*error, NSArray*list))completion {
114+
- (void) updatePatternListWithCompletion:(void (^) (NSError*error, NSArray*list))completion {
115115
@synchronized(self) {
116-
if (self.hasRefreshedBlackListFromServer) {
117-
if (completion) completion(self.error, self.blackList);
116+
if (self.hasUpdatedPatternList) {
117+
if (completion) completion(self.error, self.patternList);
118118
return;
119119
}
120-
self.hasRefreshedBlackListFromServer = YES;
120+
self.hasUpdatedPatternList = YES;
121121
}
122122

123123
self.error = nil;
@@ -135,7 +135,7 @@ - (void) refreshBlackListFromServerWithCompletion:(void (^) (NSError*error, NSAr
135135
[self.networkService networkOperationWithURLRequest:request completion:
136136
^(id<BNCNetworkOperationProtocol> operation) {
137137
[self processServerOperation:operation];
138-
if (completion) completion(self.error, self.blackList);
138+
if (completion) completion(self.error, self.patternList);
139139
[self.networkService cancelAllOperations];
140140
self.networkService = nil;
141141
}
@@ -172,9 +172,9 @@ - (void) processServerOperation:(id<BNCNetworkOperationProtocol>)operation {
172172
NSNumber *blackListVersion = dictionary[@"version"];
173173
if (![blackListVersion isKindOfClass:NSNumber.class]) return;
174174

175-
self.blackList = blackListURLs;
175+
self.patternList = blackListURLs;
176176
self.blackListVersion = [blackListVersion longValue];
177-
[BNCPreferenceHelper preferenceHelper].URLBlackList = self.blackList;
177+
[BNCPreferenceHelper preferenceHelper].URLBlackList = self.patternList;
178178
[BNCPreferenceHelper preferenceHelper].URLBlackListVersion = self.blackListVersion;
179179
}
180180

Branch-SDK/Branch.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,13 +676,13 @@ - (void)addWhiteListedScheme:(NSString *)scheme {
676676
- (void)setBlackListURLRegex:(NSArray<NSString*>*)blackListURLs {
677677
@synchronized (self) {
678678
_userURLBlackList = [[BNCURLFilter alloc] init];
679-
_userURLBlackList.blackList = blackListURLs;
679+
_userURLBlackList.patternList = blackListURLs;
680680
}
681681
}
682682

683683
- (NSArray<NSString *> *)blackListURLRegex {
684684
@synchronized (self) {
685-
return _userURLBlackList.blackList;
685+
return _userURLBlackList.patternList;
686686
}
687687
}
688688

@@ -2212,8 +2212,8 @@ - (void)handleInitSuccessAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSS
22122212
}
22132213
[self sendOpenNotificationWithLinkParameters:latestReferringParams error:nil];
22142214

2215-
if (!self.URLBlackList.hasRefreshedBlackListFromServer) {
2216-
[self.URLBlackList refreshBlackListFromServerWithCompletion:nil];
2215+
if (!self.URLBlackList.hasUpdatedPatternList) {
2216+
[self.URLBlackList updatePatternListWithCompletion:nil];
22172217
}
22182218

22192219
if (self.shouldAutomaticallyDeepLink) {

0 commit comments

Comments
 (0)