File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 183183
184184 return %orig (arg1, arg2);
185185}
186+ %end
187+
188+ // Follow request/discover section (accessed through notifications page)
189+ // Demangled name: IGFriendingCenter.IGFriendingCenterViewController
190+ %hook _TtC17IGFriendingCenter31IGFriendingCenterViewController
191+ - (id )objectsForListAdapter:(id )arg1 {
192+ NSArray *originalObjs = %orig (arg1);
193+ NSMutableArray *filteredObjs = [NSMutableArray arrayWithCapacity: [originalObjs count ]];
194+
195+ for (IGStoryTrayViewModel *obj in originalObjs) {
196+ BOOL shouldHide = NO ;
197+
198+ if ([SCIUtils getBoolPref: @" no_suggested_users" ]) {
199+
200+ // Suggested user
201+ if ([obj isKindOfClass: %c (IGDiscoverPeopleItemConfiguration)]) {
202+ NSLog (@" [SCInsta] Hiding suggested users: follow list suggested user" );
203+
204+ shouldHide = YES ;
205+ }
206+
207+ // Section header
208+ else if ([obj isKindOfClass: %c (IGLabelItemViewModel)]) {
209+
210+ // "Suggested for you" search results header
211+ if ([[obj valueForKey: @" labelTitle" ] isEqualToString: @" Suggested for you" ]) {
212+ shouldHide = YES ;
213+ }
214+
215+ }
216+
217+ }
218+
219+ // Populate new objs array
220+ if (!shouldHide) {
221+ [filteredObjs addObject: obj];
222+ }
223+ }
224+
225+ return [filteredObjs copy ];
226+ }
186227%end
You can’t perform that action at this time.
0 commit comments