Skip to content

Commit c6442f9

Browse files
committed
CORE-1198 rename some methods
1 parent 2456523 commit c6442f9

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

Branch-SDK/BNCURLFilter.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
@interface BNCURLFilter : NSObject
1818

1919
/**
20-
@brief Checks if a given URL should be ignored (blacklisted).
20+
@brief Checks if a given URL should be ignored.
2121
22-
@param url The URL to be checked.
23-
@return Returns true if the provided URL should be ignored.
22+
@param url The URL to be checked.
23+
@return Returns true if the provided URL should be ignored.
2424
*/
25-
- (BOOL) isBlackListedURL:(NSURL*_Nullable)url;
25+
- (BOOL) shouldIgnoreURL:(NSURL*_Nullable)url;
2626

2727
/**
28-
@brief Returns the pattern that matches a URL, if any.
28+
@brief Returns the pattern that matches a URL, if any.
2929
30-
@param url The URL to be checked.
31-
@return Returns the pattern matching the URL or `nil` if no patterns match.
30+
@param url The URL to be checked.
31+
@return Returns the pattern matching the URL or `nil` if no patterns match.
3232
*/
33-
- (NSString*_Nullable) blackListPatternMatchingURL:(NSURL*_Nullable)url;
33+
- (NSString*_Nullable) patternMatchingURL:(NSURL*_Nullable)url;
3434

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

Branch-SDK/BNCURLFilter.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@interface BNCURLFilter () {
1515
NSArray<NSString*>*_blackList;
1616
}
17-
@property (strong) NSArray<NSRegularExpression*> *blackListRegex;
17+
@property (strong) NSArray<NSRegularExpression*> *ignoredURLRegex;
1818
@property (assign) NSInteger blackListVersion;
1919
@property (strong) id<BNCNetworkServiceProtocol> networkService;
2020
@property (assign) BOOL hasRefreshedBlackListFromServer;
@@ -46,7 +46,7 @@ - (instancetype) init {
4646
}
4747

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

5252
return self;
@@ -60,7 +60,7 @@ - (void) dealloc {
6060
- (void) setBlackList:(NSArray<NSString *> *)blackList {
6161
@synchronized (self) {
6262
_blackList = blackList;
63-
_blackListRegex = [self.class compileRegexArray:_blackList error:nil];
63+
_ignoredURLRegex = [self.class compileRegexArray:_blackList error:nil];
6464
}
6565
}
6666

@@ -90,21 +90,21 @@ - (void) setBlackList:(NSArray<NSString *> *)blackList {
9090
return array;
9191
}
9292

93-
- (NSString*_Nullable) blackListPatternMatchingURL:(NSURL*_Nullable)url {
93+
- (NSString*_Nullable) patternMatchingURL:(NSURL*_Nullable)url {
9494
NSString *urlString = url.absoluteString;
9595
if (urlString == nil || urlString.length <= 0) return nil;
9696
NSRange range = NSMakeRange(0, urlString.length);
9797

98-
for (NSRegularExpression* regex in self.blackListRegex) {
98+
for (NSRegularExpression* regex in self.ignoredURLRegex) {
9999
NSUInteger matches = [regex numberOfMatchesInString:urlString options:0 range:range];
100100
if (matches > 0) return regex.pattern;
101101
}
102102

103103
return nil;
104104
}
105105

106-
- (BOOL) isBlackListedURL:(NSURL *)url {
107-
return ([self blackListPatternMatchingURL:url]) ? YES : NO;
106+
- (BOOL) shouldIgnoreURL:(NSURL *)url {
107+
return ([self patternMatchingURL:url]) ? YES : NO;
108108
}
109109

110110
- (void) refreshBlackListFromServer {

Branch-SDK/Branch.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ - (BOOL)handleDeepLink:(NSURL *)url sceneIdentifier:(NSString *)sceneIdentifier
702702
self.initializationStatus = BNCInitStatusUninitialized;
703703

704704
NSString *blackListPattern = nil;
705-
blackListPattern = [self.URLBlackList blackListPatternMatchingURL:url];
705+
blackListPattern = [self.URLBlackList patternMatchingURL:url];
706706
if (!blackListPattern) {
707-
blackListPattern = [_userURLBlackList blackListPatternMatchingURL:url];
707+
blackListPattern = [_userURLBlackList patternMatchingURL:url];
708708
}
709709
if (blackListPattern) {
710710
self.preferenceHelper.blacklistURLOpen = YES;

0 commit comments

Comments
 (0)