Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fixes following/follower tab empty when enable hide who to follow
Browse files Browse the repository at this point in the history
  • Loading branch information
haoict committed May 28, 2020
1 parent 07caef9 commit 56ccdd5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Tweak.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@

@interface TFNTwitterModuleFooter : NSObject
@property(nonatomic, readonly) NSURL *url;
@end
@end

@interface T1URTTimelineUserItemViewModel : NSObject
@property(readonly, nonatomic) NSString *scribeComponent;
@end
17 changes: 13 additions & 4 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
}

NSString *itemClassName = NSStringFromClass([item classForCoder]);

if (hideNewsAndTrending) {
if ([itemClassName isEqualToString:@"T1Twitter.URTTimelineTrendViewModel"]
|| [itemClassName isEqualToString:@"T1Twitter.URTTimelineEventSummaryViewModel"]
Expand All @@ -63,7 +64,12 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
}

if (hideWhoToFollow) {
if ([itemClassName isEqualToString:@"TFNTwitterUser"] || [itemClassName isEqualToString:@"T1URTTimelineUserItemViewModel"]) {
if ([itemClassName isEqualToString:@"TFNTwitterUser"]) {
[tbvCell setHidden: YES];
return tbvCell;
}

if ([itemClassName isEqualToString:@"T1URTTimelineUserItemViewModel"] && [((T1URTTimelineUserItemViewModel *)item).scribeComponent isEqualToString:@"suggest_who_to_follow"]) {
[tbvCell setHidden: YES];
return tbvCell;
}
Expand All @@ -87,8 +93,6 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
}
}

NSLog(@"hao---%@", itemClassName);

return tbvCell;
}

Expand All @@ -100,6 +104,7 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
}

NSString *itemClassName = NSStringFromClass([item classForCoder]);

if (hideNewsAndTrending) {
if ([itemClassName isEqualToString:@"T1Twitter.URTTimelineTrendViewModel"]
|| [itemClassName isEqualToString:@"T1Twitter.URTTimelineEventSummaryViewModel"]
Expand All @@ -109,7 +114,11 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
}

if (hideWhoToFollow) {
if ([itemClassName isEqualToString:@"TFNTwitterUser"] || [itemClassName isEqualToString:@"T1URTTimelineUserItemViewModel"]) {
if ([itemClassName isEqualToString:@"TFNTwitterUser"]) {
return 0;
}

if ([itemClassName isEqualToString:@"T1URTTimelineUserItemViewModel"] && [((T1URTTimelineUserItemViewModel *)item).scribeComponent isEqualToString:@"suggest_who_to_follow"]) {
return 0;
}

Expand Down

0 comments on commit 56ccdd5

Please sign in to comment.