Skip to content

Commit 02a4f32

Browse files
committed
feat: hide meta ai as recipient in share menu
1 parent 62b1af0 commit 02a4f32

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

‎src/Features/General/HideMetaAI.xm‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,37 @@
491491
NSLog(@"[SCInsta] Hiding meta ai: home feed meta ai button");
492492
}
493493
}
494+
%end
495+
496+
// Share menu recipients
497+
%hook IGDirectRecipientListViewController
498+
- (id)objectsForListAdapter:(id)arg1 {
499+
NSArray *originalObjs = %orig();
500+
NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity:[originalObjs count]];
501+
502+
for (id obj in originalObjs) {
503+
BOOL shouldHide = NO;
504+
505+
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
506+
if ([obj isKindOfClass:%c(IGDirectRecipientCellViewModel)]) {
507+
508+
// Meta AI (catch-all)
509+
if ([[[obj recipient] threadName] isEqualToString:@"Meta AI"]) {
510+
NSLog(@"[SCInsta] Hiding meta ai suggested as recipient (share menu)");
511+
512+
shouldHide = YES;
513+
}
514+
515+
}
516+
}
517+
518+
// Populate new objs array
519+
if (!shouldHide) {
520+
[filteredObjs addObject:obj];
521+
}
522+
523+
}
524+
525+
return [filteredObjs copy];
526+
}
494527
%end

0 commit comments

Comments
 (0)