Skip to content

Commit

Permalink
Remove premium banner on newest YTM
Browse files Browse the repository at this point in the history
  • Loading branch information
dayanch96 committed Jun 16, 2024
1 parent 518f367 commit b74cbca
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Source/Settings.x
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
[arrDown addObjectsFromArray:arg2];
[arrDown addObject:button];

//Remove the subscribe to premium button.
//Remove the subscribe to premium button on old versions
NSMutableArray *arrUp = [[NSMutableArray alloc] init];
for (YTMAccountButton *yt_button in arg1) {
if (![[yt_button.titleLabel text] containsString:@"Premium"]) {
Expand All @@ -74,6 +74,23 @@
}
%end

@interface YTMAvatarAccountViewController : UIViewController
@end

@interface YTMNavigationDrawerPromoView : UIView
@end

// Remove the subscribe to premium button on new versions
%hook YTMNavigationDrawerPromoView
- (void)loadModel:(id)model {
if ([self._viewControllerForAncestor isKindOfClass:%c(YTMAvatarAccountViewController)]) {
return [self removeFromSuperview];
}

%orig(model);
}
%end

%hook YTMMessageView
- (void)setMessageText:(id)arg1 {
if (![self.delegate isKindOfClass:%c(YTMLightweightMessageCell)]) {
Expand Down

0 comments on commit b74cbca

Please sign in to comment.