Skip to content

Commit b2b1b97

Browse files
committed
feat: hide messages tab
1 parent d7e224b commit b2b1b97

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ A feature-rich tweak for Instagram on iOS!\
8585
- Hiding tabs
8686
- Hide feed tab
8787
- Hide explore tab
88+
- Hide messages tab
8889
- Hide reels tab
8990
- Hide create tab
9091

src/Features/General/Navigation.xm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ BOOL isSurfaceShown(IGMainAppSurfaceIntent *surface) {
1313
isShown = NO;
1414
}
1515

16+
// Messages
17+
else if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"DIRECT"] && [SCIUtils getBoolPref:@"hide_messages_tab"]) {
18+
isShown = NO;
19+
}
20+
1621
// Explore
1722
else if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"SEARCH"] && [SCIUtils getBoolPref:@"hide_explore_tab"]) {
1823
isShown = NO;
@@ -97,4 +102,19 @@ NSArray *filterSurfacesArray(NSArray *surfaces) {
97102
- (void)setIsTabSwipingEnabled:(BOOL)arg1 {
98103
return;
99104
}
105+
%end
106+
107+
%hook IGHomeFeedHeaderView
108+
- (void)didMoveToWindow {
109+
%orig;
110+
111+
if ([SCIUtils getBoolPref:@"hide_messages_tab"]) {
112+
UIButton *rightButton = [self valueForKey:@"rightButton"];
113+
if (rightButton) {
114+
NSLog(@"[SCInsta] Hiding messages tab (on feed)");
115+
116+
[rightButton removeFromSuperview];
117+
}
118+
}
119+
}
100120
%end

src/InstagramHeaders.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@
287287
- (void)handleLongPress:(UILongPressGestureRecognizer *)gr; // new
288288
@end
289289

290+
@interface IGHomeFeedHeaderView : UIView
291+
@end
292+
290293
@interface IGHomeFeedHeaderViewController
291294
- (void)headerDidLongPressLogo:(id)arg1;
292295
@end

src/Settings/TweakSettings.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ + (NSArray *)sections {
162162
@"rows": @[
163163
[SCISetting switchCellWithTitle:@"Hide feed tab" subtitle:@"Hides the feed/home tab on the bottom navigation bar" defaultsKey:@"hide_feed_tab" requiresRestart:YES],
164164
[SCISetting switchCellWithTitle:@"Hide explore tab" subtitle:@"Hides the explore/search tab on the bottom navigation bar" defaultsKey:@"hide_explore_tab" requiresRestart:YES],
165+
[SCISetting switchCellWithTitle:@"Hide messages tab" subtitle:@"Hides the direct messages tab on the bottom navigation bar" defaultsKey:@"hide_messages_tab" requiresRestart:YES],
165166
[SCISetting switchCellWithTitle:@"Hide reels tab" subtitle:@"Hides the reels tab on the bottom navigation bar" defaultsKey:@"hide_reels_tab" requiresRestart:YES],
166167
[SCISetting switchCellWithTitle:@"Hide create tab" subtitle:@"Hides the create tab on the bottom navigation bar" defaultsKey:@"hide_create_tab" requiresRestart:YES]
167168
]

0 commit comments

Comments
 (0)