Skip to content

Commit

Permalink
fix: hide meta ai functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed May 17, 2024
1 parent b7c4588 commit b59f47e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
24 changes: 23 additions & 1 deletion src/Features/General/HideMetaAI.xm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ accessibilityTraits:(NSUInteger)arg5

// Explore

// Meta AI search bar: explore search results data
// Meta AI search bar: explore/user search results data
%hook IGSearchListKitDataSource
- (id)objectsForListAdapter:(id)arg1 {
NSMutableArray *newObjs = [%orig mutableCopy];
Expand Down Expand Up @@ -159,6 +159,15 @@ accessibilityTraits:(NSUInteger)arg5

}

// Meta AI user account in search results
else if ([[[obj title] string] isEqualToString:@"meta.ai"]) {
if ([SCIManager hideMetaAI]) {
NSLog(@"[SCInsta] Hiding meta ai: explore search results meta ai user account suggestion");

[newObjs removeObjectAtIndex:idx];
}
}

}

}];
Expand Down Expand Up @@ -234,6 +243,19 @@ accessibilityTraits:(NSUInteger)arg5
}
%end

// Search bar donut button
%hook IGSearchBarDonutButton
- (void)didMoveToWindow {
%orig;

if ([SCIManager hideMetaAI]) {
NSLog(@"[SCInsta] Hiding meta ai: search bar donut button");

[self removeFromSuperview];
}
}
%end

// Search typeahead
%hook IGSearchTypeaheadViewController
- (void)_presentMetaAIThreadWithDirectEntryPoint:(NSInteger)arg1 searchEntryPoint:(NSInteger)arg2 prompt:(id)arg3 {
Expand Down
19 changes: 15 additions & 4 deletions src/InstagramHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@
- (id)labelTitle;
@end

@interface IGDirectInboxSuggestedThreadCellViewModel : NSObject
@end

@interface IGDirectInboxHeaderCellViewModel : NSObject
- (id)title;
@end

@interface IGSearchResultViewModel : NSObject
- (id)title;
- (NSUInteger)itemType;
@end

Expand All @@ -297,16 +305,19 @@
- (id)delegate;
@end

@interface IGBadgedNavigationButton : UIView
- (id)initWithIcon:(UIImage *)icon target:(id)target action:(SEL)action buttonType:(NSUInteger)buttonType;
- (void)handleLongPress; // new
@interface IGImageWithAccessoryButton : IGTapButton
@end

@interface IGSearchBarDonutButton : UIView
@end

@interface IGImageWithAccessoryButton : IGTapButton
@interface IGAnimatablePlaceholderTextField : UITextField
@end





/////////////////////////////////////////////////////////////////////////////


Expand Down

0 comments on commit b59f47e

Please sign in to comment.