forked from BandarHL/BHInstagram
-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#import "../../InstagramHeaders.h" | ||
#import "../../Manager.h" | ||
|
||
// Channels dms tab (header) | ||
%hook IGDirectInboxHeaderSectionController | ||
- (id)viewModel { | ||
if ([[%orig title] isEqualToString:@"Suggested"]) { | ||
|
||
if ([BHIManager noSuggestedChats]) { | ||
NSLog(@"[BHInsta] Hiding suggested chats"); | ||
|
||
return nil; | ||
} | ||
else { | ||
return %orig; | ||
} | ||
|
||
} else { | ||
return %orig; | ||
} | ||
} | ||
%end | ||
|
||
// Channels dms tab (recipients) | ||
%hook IGDirectInboxSuggestedThreadSectionController | ||
- (id)initWithUserSession:(id)arg1 analyticsModule:(id)arg2 delegate:(id)arg3 igvpController:(id)arg4 viewPointActionBlock:(id)arg5 entryPointProvider:(id)arg6 { | ||
if ([BHIManager noSuggestedChats]) { | ||
NSLog(@"[BHInsta] Hiding suggested chats"); | ||
|
||
return nil; | ||
} | ||
else { | ||
return %orig; | ||
} | ||
} | ||
%end | ||
|
||
// Dms search (sponsored section) | ||
%hook IGDirectInboxSearchListAdapterDataSource | ||
- (id)objectsForListAdapter:(id)arg1 { | ||
if ([BHIManager noSuggestedChats]) { | ||
|
||
NSMutableArray *newObjs = [%orig mutableCopy]; | ||
|
||
[newObjs enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | ||
|
||
// Section header | ||
if ([obj isKindOfClass:%c(IGLabelItemViewModel)]) { | ||
if ([[obj labelTitle] isEqualToString:@"Suggested channels"]) { | ||
NSLog(@"[BHInsta] Hiding suggested chats (header)"); | ||
|
||
[newObjs removeObjectAtIndex:idx]; | ||
} | ||
} | ||
|
||
// Broadcast channel recipient | ||
else if ([obj isKindOfClass:%c(IGDirectRecipientCellViewModel)]) { | ||
if ([[obj recipient] isBroadcastChannel]) { | ||
NSLog(@"[BHInsta] Hiding suggested chats (recipients)"); | ||
|
||
[newObjs removeObjectAtIndex:idx]; | ||
} | ||
} | ||
|
||
}]; | ||
|
||
return [newObjs copy]; | ||
|
||
} | ||
else { | ||
return %orig; | ||
} | ||
} | ||
%end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters