Skip to content

Commit 25d05c9

Browse files
committed
feat: improve hiding suggested users in story tray
1 parent ac438ca commit 25d05c9

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

src/Tweak.x

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,16 @@ shouldPersistLastBugReportId:(id)arg6
510510
BOOL shouldHide = NO;
511511

512512
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
513-
// This hides as many recommended models as possible, without hiding genuine models
514-
// Most recommended models share a 32 digit id, unlike normal accounts
515-
if ([obj isKindOfClass:%c(IGStoryTrayViewModel)] && [obj.pk length] == 32) {
516-
NSLog(@"[SCInsta] Hiding suggested users: story tray");
513+
if ([obj isKindOfClass:%c(IGStoryTrayViewModel)]) {
514+
NSNumber *type = [((IGStoryTrayViewModel *)obj) valueForKey:@"type"];
515+
516+
// 8/9 looks to be the types for recommended stories
517+
if ([type isEqual:@(8)] || [type isEqual:@(9)]) {
518+
NSLog(@"[SCInsta] Hiding suggested users: story tray");
517519

518-
shouldHide = YES;
520+
shouldHide = YES;
521+
522+
}
519523
}
520524
}
521525

@@ -538,6 +542,15 @@ shouldPersistLastBugReportId:(id)arg6
538542
}
539543
%end
540544

545+
// Story tray expanded footer (Suggested accounts to follow)
546+
%hook IGStoryTraySectionController
547+
- (void)storyTrayControllerShowSUPOGEducationBump {
548+
if ([SCIUtils getBoolPref:@"no_suggested_users"]) return;
549+
550+
return %orig();
551+
}
552+
%end
553+
541554
// Modern IGDS app menus
542555
%hook IGDSMenu
543556
- (id)initWithMenuItems:(NSArray<IGDSMenuItem *> *)originalObjs edr:(BOOL)edr headerLabelText:(id)headerLabelText {

0 commit comments

Comments
 (0)