Skip to content

Commit

Permalink
Version 1.1 Thanks to Vantablack.
Browse files Browse the repository at this point in the history
  • Loading branch information
gilshahar7 authored Sep 7, 2018
1 parent 46377d2 commit 46cd904
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions XXXApolloOpener.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ - (instancetype)init {
}

- (id)openURL:(NSURL *)url sender:(NSString *)sender {

if ([url.host isEqualToString:@"www.reddit.com"] ||
[url.host isEqualToString:@"reddit.com"] ||
[url.host isEqualToString:@"m.reddit.com"] ||
[url.host isEqualToString:@"old.reddit.com"] ||
[url.host containsString:@".reddit.com"]) {

if ([url.path isEqualToString:@"/"]) {
return [NSURL URLWithString:@"apollo://"];
} else {
return [NSURL URLWithString:[NSString stringWithFormat:@"apollo://reddit.com%@/?%@", url.path, url.query]];
}
}

if ([url.host isEqualToString:@"www.reddit.com"] ||
[url.host isEqualToString:@"reddit.com"] ||
[url.host isEqualToString:@"m.reddit.com"] ||
[url.host isEqualToString:@"old.reddit.com"] ||
[url.host containsString:@".reddit.com"]) {

if ([url.path isEqualToString:@"/"] || [url.path isEqualToString:@""]) {
return [NSURL URLWithString:@"apollo://"];
} else {
return [NSURL URLWithString:[NSString stringWithFormat:@"apollo://reddit.com%@/?%@", url.path, url.query]];
}
}

return nil;
}
Expand Down

0 comments on commit 46cd904

Please sign in to comment.