|
|
|
|
|
|
|
|
static BOOL isTFDeletedOnly;
|
|
|
static BOOL isTFDeletedOnly;
|
|
|
static CGFloat pushshiftRequestTimeoutValue;
|
|
|
static CGFloat pushshiftRequestTimeoutValue;
|
|
|
|
|
|
|
|
|
int firstVersionPart = 2020;
|
|
|
|
|
|
|
|
|
int firstVersionPart = 0;
|
|
|
int secondVersionPart = 0;
|
|
|
int secondVersionPart = 0;
|
|
|
|
|
|
|
|
|
%group Reddit_v4_current
|
|
|
%group Reddit_v4_current
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%end
|
|
|
%end
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
%hook Post
|
|
|
|
|
|
|
|
|
|
|
|
- (id)previewTextWithTheme:(id)arg1 {
|
|
|
|
|
|
%log;
|
|
|
|
|
|
id orig = %orig;
|
|
|
|
|
|
HBLogDebug(@"previewTextWithTheme: orig: %@", orig);
|
|
|
|
|
|
return orig;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (id)previewFeedPostTextString {
|
|
|
|
|
|
%log;
|
|
|
|
|
|
id orig = %orig;
|
|
|
|
|
|
HBLogDebug(@"previewFeedPostTextString orig: %@", orig);
|
|
|
|
|
|
return orig;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (id)previewPostText:(id)arg1 {
|
|
|
|
|
|
%log;
|
|
|
|
|
|
id orig = %orig;
|
|
|
|
|
|
HBLogDebug(@"previewPostText: orig: %@", orig);
|
|
|
|
|
|
return orig;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
%end
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
%hook PostDetailViewController
|
|
|
%hook PostDetailViewController
|
|
|
%property(strong,nonatomic) id feedPostTextWithThumbnailNode;
|
|
|
%property(strong,nonatomic) id feedPostTextWithThumbnailNode;
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
NSMutableAttributedString *bodyMutableAttributedText;
|
|
|
|
|
|
|
|
|
|
|
|
if ((firstVersionPart == 2020 && secondVersionPart <= 41) || firstVersionPart != 2020) {
|
|
|
|
|
|
bodyMutableAttributedText = [[post previewFeedPostTextString] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
|
|
|
} else {
|
|
|
|
|
|
bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
|
|
|
}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
|
|
|
|
|
|
[bodyMutableAttributedText beginEditing];
|
|
|
[bodyMutableAttributedText beginEditing];
|
|
|
|
|
|
|
|
|
[post setSelfText:body];
|
|
|
[post setSelfText:body];
|
|
|
[post setAuthor:author];
|
|
|
[post setAuthor:author];
|
|
|
[post setSelfPostRichTextAttributed:bodyMutableAttributedText];
|
|
|
[post setSelfPostRichTextAttributed:bodyMutableAttributedText];
|
|
|
[post setPreviewFeedPostTextString:bodyMutableAttributedText];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FeedPostTitleNode *titleNode = [[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] titleNode];
|
|
|
|
|
|
Post *feedPost = [titleNode post];
|
|
|
|
|
|
[feedPost setAuthor:author];
|
|
|
|
|
|
|
|
|
if (firstVersionPart == 2020) {
|
|
|
if (firstVersionPart == 2020) {
|
|
|
[[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] configureSelfTextNode];
|
|
|
|
|
|
|
|
|
if (secondVersionPart >= 42) {
|
|
|
|
|
|
RichTextDisplayNode *selfTextNode = [[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] selfTextNode];
|
|
|
|
|
|
[selfTextNode setAttributedText:bodyMutableAttributedText];
|
|
|
|
|
|
[selfTextNode configureDisplayNodes];
|
|
|
|
|
|
} else {
|
|
|
|
|
|
[post setPreviewFeedPostTextString:bodyMutableAttributedText];
|
|
|
|
|
|
[[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] configureSelfTextNode];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (secondVersionPart >= 41) {
|
|
|
|
|
|
[titleNode configureNodes];
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
} else {
|
|
|
|
|
|
[post setPreviewFeedPostTextString:bodyMutableAttributedText];
|
|
|
|
|
|
|
|
|
if (secondVersionPart >= 44) {
|
|
|
if (secondVersionPart >= 44) {
|
|
|
[[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] configureSelfTextNode];
|
|
|
[[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] configureSelfTextNode];
|
|
|
} else if (secondVersionPart >= 38) {
|
|
|
} else if (secondVersionPart >= 38) {
|
|
|
|
|
|
|
|
|
secondVersionPart = [redditVersion[1] intValue];
|
|
|
secondVersionPart = [redditVersion[1] intValue];
|
|
|
}
|
|
|
}
|
|
|
@catch (NSException *exc) {
|
|
|
@catch (NSException *exc) {
|
|
|
firstVersionPart = 2020;
|
|
|
|
|
|
|
|
|
firstVersionPart = 0;
|
|
|
secondVersionPart = 0;
|
|
|
secondVersionPart = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)prefsChanged, CFSTR("com.lint.undelete.prefs.changed"), NULL, CFNotificationSuspensionBehaviorCoalesce);
|
|
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)prefsChanged, CFSTR("com.lint.undelete.prefs.changed"), NULL, CFNotificationSuspensionBehaviorCoalesce);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
if (firstVersionPart == 4 || firstVersionPart == 2020) {
|
|
|
if (firstVersionPart == 4 || firstVersionPart == 2020) {
|
|
|
if (secondVersionPart <= 32 && firstVersionPart != 2020) {
|
|
|
if (secondVersionPart <= 32 && firstVersionPart != 2020) {
|
|
|
%init(Reddit_v4_ios10);
|
|
|
%init(Reddit_v4_ios10);
|
|
|
|
|
|
|
|
|
} else if (firstVersionPart == 3) {
|
|
|
} else if (firstVersionPart == 3) {
|
|
|
%init(Reddit_v3);
|
|
|
%init(Reddit_v3);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
if (firstVersionPart >= 2020 || (firstVersionPart == 4 && secondVersionPart > 32)) {
|
|
|
|
|
|
%init(Reddit_v4_current);
|
|
|
|
|
|
} else if (firstVersionPart == 4 && secondVersionPart <= 32) {
|
|
|
|
|
|
%init(Reddit_v4_ios10);
|
|
|
|
|
|
} else if (firstVersionPart == 3) {
|
|
|
|
|
|
%init(Reddit_v3);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|