Skip to content

Commit c2bb792

Browse files
committed
fix: no suggested posts crashing newer Instagram version
The “isOrganicMedia” property was removed from the IGMedia class in v415 (pretty sure). This was causing the crashes on feed load. After decompiling “+ [_TtC17IGMediaExtensions26IGMediaOrganicMediaHelpers isOrganicMedia:]”, I discovered the “explorePostInFeed” property on IGBaseMedia. This appears to be the same value that “isOrganicMedia” had in older versions.
1 parent 303f27a commit c2bb792

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/Features/Feed/HideFeedItems.xm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static NSArray *removeItemsInList(NSArray *list, BOOL isFeed) {
1111

1212
// Posts
1313
if (
14-
([obj isKindOfClass:%c(IGMedia)] && !((IGMedia *)obj).isOrganicMedia)
14+
([obj isKindOfClass:%c(IGMedia)] && [((IGMedia *)obj).explorePostInFeed isEqual:@YES])
1515
|| ([obj isKindOfClass:%c(IGFeedGroupHeaderViewModel)] && [[obj title] isEqualToString:@"Suggested Posts"])
1616
) {
1717
NSLog(@"[SCInsta] Removing suggested posts");

src/InstagramHeaders.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@
8383
- (id)imageURLForWidth:(CGFloat)width;
8484
@end
8585

86-
@interface IGMedia : NSObject
87-
@property(nonatomic, readonly) BOOL isOrganicMedia;
86+
@interface IGBaseMedia : NSObject
87+
@property (retain, nonatomic) id explorePostInFeed;
88+
@end
89+
90+
@interface IGMedia : IGBaseMedia
8891
@property(readonly) IGVideo *video;
8992
@property(readonly) IGPhoto *photo;
9093
@end

0 commit comments

Comments
 (0)