mirror of
https://github.com/lint/TFDidThatSay
synced 2025-07-04 16:36:46 +00:00
Add universal visibility option
This commit is contained in:
@ -100,7 +100,7 @@
|
|||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
<string>PSGroupCell</string>
|
<string>PSGroupCell</string>
|
||||||
<key>footerText</key>
|
<key>footerText</key>
|
||||||
<string>On apps that have an eye button rather than an option in the menu, enable or disable that button from appearing on only deleted comments/posts.</string>
|
<string>Enable or disable undelete option appearing only on deleted/removed comments and posts.</string>
|
||||||
<key>label</key>
|
<key>label</key>
|
||||||
<string>visibility</string>
|
<string>visibility</string>
|
||||||
</dict>
|
</dict>
|
||||||
@ -114,51 +114,9 @@
|
|||||||
<key>defaults</key>
|
<key>defaults</key>
|
||||||
<string>com.lint.undelete.prefs</string>
|
<string>com.lint.undelete.prefs</string>
|
||||||
<key>key</key>
|
<key>key</key>
|
||||||
<string>isApolloDeletedCommentsOnly</string>
|
<string>isTFDeletedOnly</string>
|
||||||
<key>label</key>
|
<key>label</key>
|
||||||
<string>Apollo | Deleted only</string>
|
<string>Deleted comments/posts only</string>
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>PostNotification</key>
|
|
||||||
<string>com.lint.undelete.prefs.changed</string>
|
|
||||||
<key>cell</key>
|
|
||||||
<string>PSSwitchCell</string>
|
|
||||||
<key>default</key>
|
|
||||||
<true/>
|
|
||||||
<key>defaults</key>
|
|
||||||
<string>com.lint.undelete.prefs</string>
|
|
||||||
<key>key</key>
|
|
||||||
<string>isAlienBlueDeletedOnly</string>
|
|
||||||
<key>label</key>
|
|
||||||
<string>Alien Blue | Deleted only</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>PostNotification</key>
|
|
||||||
<string>com.lint.undelete.prefs.changed</string>
|
|
||||||
<key>cell</key>
|
|
||||||
<string>PSSwitchCell</string>
|
|
||||||
<key>default</key>
|
|
||||||
<true/>
|
|
||||||
<key>defaults</key>
|
|
||||||
<string>com.lint.undelete.prefs</string>
|
|
||||||
<key>key</key>
|
|
||||||
<string>isSlideDeletedOnly</string>
|
|
||||||
<key>label</key>
|
|
||||||
<string>Slide | Deleted only</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>PostNotification</key>
|
|
||||||
<string>com.lint.undelete.prefs.changed</string>
|
|
||||||
<key>cell</key>
|
|
||||||
<string>PSSwitchCell</string>
|
|
||||||
<key>default</key>
|
|
||||||
<true/>
|
|
||||||
<key>defaults</key>
|
|
||||||
<string>com.lint.undelete.prefs</string>
|
|
||||||
<key>key</key>
|
|
||||||
<string>isBaconReaderDeletedOnly</string>
|
|
||||||
<key>label</key>
|
|
||||||
<string>BaconReader | Deleted only</string>
|
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>cell</key>
|
<key>cell</key>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#import "assets/MMMarkdown.h"
|
#import "assets/MMMarkdown.h"
|
||||||
|
|
||||||
static BOOL isAlienBlueEnabled;
|
static BOOL isAlienBlueEnabled;
|
||||||
static BOOL isAlienBlueDeletedOnly;
|
static BOOL isTFDeletedOnly;
|
||||||
static CGFloat pushshiftRequestTimeoutValue;
|
static CGFloat pushshiftRequestTimeoutValue;
|
||||||
|
|
||||||
%group AlienBlue
|
%group AlienBlue
|
||||||
@ -21,7 +21,7 @@ static CGFloat pushshiftRequestTimeoutValue;
|
|||||||
body = [[(CommentNode *)arg1 comment] body];
|
body = [[(CommentNode *)arg1 comment] body];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((isAlienBlueDeletedOnly && ([body isEqualToString:@"[deleted]"] || [body isEqualToString:@"[removed]"])) || !isAlienBlueDeletedOnly) {
|
if ((isTFDeletedOnly && ([body isEqualToString:@"[deleted]"] || [body isEqualToString:@"[removed]"])) || !isTFDeletedOnly) {
|
||||||
|
|
||||||
CGSize refSize = [[self buttons][0] frame].size;
|
CGSize refSize = [[self buttons][0] frame].size;
|
||||||
|
|
||||||
@ -158,10 +158,10 @@ static void loadPrefs(){
|
|||||||
isAlienBlueEnabled = YES;
|
isAlienBlueEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"isAlienBlueDeletedOnly"] != nil){
|
if ([prefs objectForKey:@"isTFDeletedOnly"] != nil){
|
||||||
isAlienBlueDeletedOnly = [[prefs objectForKey:@"isAlienBlueDeletedOnly"] boolValue];
|
isTFDeletedOnly = [[prefs objectForKey:@"isTFDeletedOnly"] boolValue];
|
||||||
} else {
|
} else {
|
||||||
isAlienBlueDeletedOnly = YES;
|
isTFDeletedOnly = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
||||||
@ -172,7 +172,7 @@ static void loadPrefs(){
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
isAlienBlueEnabled = YES;
|
isAlienBlueEnabled = YES;
|
||||||
isAlienBlueDeletedOnly = YES;
|
isTFDeletedOnly = YES;
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
#import "Apollo.h"
|
#import "Apollo.h"
|
||||||
|
|
||||||
static BOOL isApolloDeletedCommentsOnly;
|
static BOOL isTFDeletedOnly;
|
||||||
static BOOL isApolloEnabled;
|
static BOOL isApolloEnabled;
|
||||||
static CGFloat pushshiftRequestTimeoutValue;
|
static CGFloat pushshiftRequestTimeoutValue;
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ NSDictionary* apolloBodyAttributes = nil;
|
|||||||
|
|
||||||
id commentBody = [MSHookIvar<id>(self, "comment") body];
|
id commentBody = [MSHookIvar<id>(self, "comment") body];
|
||||||
|
|
||||||
if ((isApolloDeletedCommentsOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isApolloDeletedCommentsOnly) {
|
if ((isTFDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly) {
|
||||||
|
|
||||||
CGFloat imageSize = 20.0f;
|
CGFloat imageSize = 20.0f;
|
||||||
|
|
||||||
@ -190,15 +190,17 @@ NSDictionary* apolloBodyAttributes = nil;
|
|||||||
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes]];
|
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes]];
|
||||||
|
|
||||||
[sender setEnabled:YES];
|
[sender setEnabled:YES];
|
||||||
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void) didLoad{
|
-(void) didLoad{
|
||||||
%orig;
|
%orig;
|
||||||
|
|
||||||
if ([MSHookIvar<id>(self, "link") isSelfPost]){
|
id post = MSHookIvar<id>(self, "link");
|
||||||
|
id postBody = [post selfText];
|
||||||
|
|
||||||
|
if ([post isSelfPost]){
|
||||||
|
if ((isTFDeletedOnly && ([postBody isEqualToString:@"[deleted]"] || [postBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly) {
|
||||||
|
|
||||||
CGFloat imageSize = 20.0f;
|
CGFloat imageSize = 20.0f;
|
||||||
|
|
||||||
@ -213,6 +215,7 @@ NSDictionary* apolloBodyAttributes = nil;
|
|||||||
[self setUndeleteButton:undeleteButton];
|
[self setUndeleteButton:undeleteButton];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-(void) _layoutSublayouts{
|
-(void) _layoutSublayouts{
|
||||||
%orig;
|
%orig;
|
||||||
@ -230,6 +233,7 @@ NSDictionary* apolloBodyAttributes = nil;
|
|||||||
[[self undeleteButton] setFrame:CGRectMake(buttonXPos, centerHeight - (imageSize / 2), imageSize, imageSize)];
|
[[self undeleteButton] setFrame:CGRectMake(buttonXPos, centerHeight - (imageSize / 2), imageSize, imageSize)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%end
|
%end
|
||||||
@ -246,22 +250,22 @@ static void loadPrefs(){
|
|||||||
isApolloEnabled = YES;
|
isApolloEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([prefs objectForKey:@"isTFDeletedOnly"] != nil) {
|
||||||
|
isTFDeletedOnly = [[prefs objectForKey:@"isTFDeletedOnly"] boolValue];
|
||||||
|
} else {
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
||||||
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
||||||
} else {
|
} else {
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"isApolloDeletedCommentsOnly"] != nil) {
|
|
||||||
isApolloDeletedCommentsOnly = [[prefs objectForKey:@"isApolloDeletedCommentsOnly"] boolValue];
|
|
||||||
} else {
|
|
||||||
isApolloDeletedCommentsOnly = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
isApolloEnabled = YES;
|
isApolloEnabled = YES;
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
isApolloDeletedCommentsOnly = YES;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#import "assets/MMMarkdown.h"
|
#import "assets/MMMarkdown.h"
|
||||||
|
|
||||||
static BOOL isBaconReaderEnabled;
|
static BOOL isBaconReaderEnabled;
|
||||||
static BOOL isBaconReaderDeletedOnly;
|
static BOOL isTFDeletedOnly;
|
||||||
static CGFloat pushshiftRequestTimeoutValue;
|
static CGFloat pushshiftRequestTimeoutValue;
|
||||||
|
|
||||||
%group BaconReader
|
%group BaconReader
|
||||||
@ -73,9 +73,9 @@ id tfStoryController;
|
|||||||
UIAlertAction *undeleteAction;
|
UIAlertAction *undeleteAction;
|
||||||
|
|
||||||
if (tfCommentCellView){
|
if (tfCommentCellView){
|
||||||
undeleteAction = [UIAlertAction actionWithTitle:@"TF Did That Say?" style:nil handler:^(UIAlertAction* action){[tfStoryController handleUndeleteCommentAction];}];
|
undeleteAction = [UIAlertAction actionWithTitle:@"TF Did That Say?" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){[tfStoryController handleUndeleteCommentAction];}];
|
||||||
} else {
|
} else {
|
||||||
undeleteAction = [UIAlertAction actionWithTitle:@"TF Did That Say?" style:nil handler:^(UIAlertAction* action){[tfStoryController handleUndeletePostAction];}];
|
undeleteAction = [UIAlertAction actionWithTitle:@"TF Did That Say?" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){[tfStoryController handleUndeletePostAction];}];
|
||||||
}
|
}
|
||||||
|
|
||||||
[arg1 addAction:undeleteAction];
|
[arg1 addAction:undeleteAction];
|
||||||
@ -93,7 +93,7 @@ id tfStoryController;
|
|||||||
|
|
||||||
NSString *commentBody = [[arg1 comment] body];
|
NSString *commentBody = [[arg1 comment] body];
|
||||||
|
|
||||||
if ((isBaconReaderDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isBaconReaderDeletedOnly) {
|
if ((isTFDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly) {
|
||||||
shouldHaveBRUndeleteAction = YES;
|
shouldHaveBRUndeleteAction = YES;
|
||||||
tfCommentCellView = arg1;
|
tfCommentCellView = arg1;
|
||||||
tfStoryController = self;
|
tfStoryController = self;
|
||||||
@ -110,7 +110,7 @@ id tfStoryController;
|
|||||||
if ([[self story] is_selfValue]){
|
if ([[self story] is_selfValue]){
|
||||||
NSString *postBody = [[self story] selftext];
|
NSString *postBody = [[self story] selftext];
|
||||||
|
|
||||||
if ((isBaconReaderDeletedOnly && ([postBody isEqualToString:@"[deleted]"] || [postBody isEqualToString:@"[removed]"])) || !isBaconReaderDeletedOnly) {
|
if ((isTFDeletedOnly && ([postBody isEqualToString:@"[deleted]"] || [postBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly) {
|
||||||
shouldHaveBRUndeleteAction = YES;
|
shouldHaveBRUndeleteAction = YES;
|
||||||
tfCommentCellView = nil;
|
tfCommentCellView = nil;
|
||||||
tfStoryController = self;
|
tfStoryController = self;
|
||||||
@ -223,21 +223,21 @@ static void loadPrefs(){
|
|||||||
isBaconReaderEnabled = YES;
|
isBaconReaderEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([prefs objectForKey:@"isTFDeletedOnly"] != nil) {
|
||||||
|
isTFDeletedOnly = [[prefs objectForKey:@"isTFDeletedOnly"] boolValue];
|
||||||
|
} else {
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
||||||
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
||||||
} else {
|
} else {
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"isBaconReaderDeletedOnly"] != nil) {
|
|
||||||
isBaconReaderDeletedOnly = [[prefs objectForKey:@"isBaconReaderDeletedOnly"] boolValue];
|
|
||||||
} else {
|
|
||||||
isBaconReaderDeletedOnly = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
isBaconReaderEnabled = YES;
|
isBaconReaderEnabled = YES;
|
||||||
isBaconReaderDeletedOnly = YES;
|
isTFDeletedOnly = YES;
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#import "Narwhal.h"
|
#import "Narwhal.h"
|
||||||
|
|
||||||
static BOOL isNarwhalEnabled;
|
static BOOL isNarwhalEnabled;
|
||||||
|
static BOOL isTFDeletedOnly;
|
||||||
static CGFloat pushshiftRequestTimeoutValue;
|
static CGFloat pushshiftRequestTimeoutValue;
|
||||||
|
|
||||||
%group Narwhal
|
%group Narwhal
|
||||||
@ -45,7 +46,6 @@ void getUndeleteCommentData(id controller, id comment){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%hook UIViewController
|
%hook UIViewController
|
||||||
|
|
||||||
-(void) presentViewController:(id) arg1 animated:(BOOL) arg2 completion:(id) arg3{
|
-(void) presentViewController:(id) arg1 animated:(BOOL) arg2 completion:(id) arg3{
|
||||||
@ -55,9 +55,9 @@ void getUndeleteCommentData(id controller, id comment){
|
|||||||
UIAlertAction* undeleteAction;
|
UIAlertAction* undeleteAction;
|
||||||
|
|
||||||
if (tfComment){
|
if (tfComment){
|
||||||
undeleteAction = [UIAlertAction actionWithTitle:@"tf did that say?" style:nil handler:^(UIAlertAction* action){getUndeleteCommentData(tfController, tfComment);}];
|
undeleteAction = [UIAlertAction actionWithTitle:@"tf did that say?" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){getUndeleteCommentData(tfController, tfComment);}];
|
||||||
} else {
|
} else {
|
||||||
undeleteAction = [UIAlertAction actionWithTitle:@"tf did that say?" style:nil handler:^(UIAlertAction* action){[tfController handleUndeletePostAction];}];
|
undeleteAction = [UIAlertAction actionWithTitle:@"tf did that say?" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){[tfController handleUndeletePostAction];}];
|
||||||
}
|
}
|
||||||
|
|
||||||
[arg1 addAction:undeleteAction];
|
[arg1 addAction:undeleteAction];
|
||||||
@ -70,8 +70,6 @@ void getUndeleteCommentData(id controller, id comment){
|
|||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%hook NRTLinkViewController
|
%hook NRTLinkViewController
|
||||||
|
|
||||||
%new
|
%new
|
||||||
@ -141,29 +139,35 @@ void getUndeleteCommentData(id controller, id comment){
|
|||||||
-(void) swipeCell:(id) arg1 didEndDragWithState:(NSUInteger) arg2{
|
-(void) swipeCell:(id) arg1 didEndDragWithState:(NSUInteger) arg2{
|
||||||
|
|
||||||
if (arg2 == 2){
|
if (arg2 == 2){
|
||||||
|
|
||||||
if ([arg1 isKindOfClass:[%c(NRTCommentTableViewCell) class]]) {
|
if ([arg1 isKindOfClass:[%c(NRTCommentTableViewCell) class]]) {
|
||||||
|
|
||||||
|
NSString *commentBody = MSHookIvar<NSString*>([arg1 comment], "_body");
|
||||||
|
|
||||||
|
if ((isTFDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
tfComment = [arg1 comment];
|
tfComment = [arg1 comment];
|
||||||
tfController = self;
|
tfController = self;
|
||||||
shouldHaveUndeleteAction = YES;
|
shouldHaveUndeleteAction = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
%orig;
|
%orig;
|
||||||
|
|
||||||
shouldHaveUndeleteAction = NO;
|
shouldHaveUndeleteAction = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-(void) _dotsButtonTouched:(id) arg1{
|
-(void) _dotsButtonTouched:(id) arg1{
|
||||||
|
|
||||||
if ([self linkTextOffscreenCell]){
|
if ([self linkTextOffscreenCell]){
|
||||||
|
|
||||||
|
NSString *postBody = [[self link] selfText];
|
||||||
|
|
||||||
|
if ((isTFDeletedOnly && ([postBody isEqualToString:@"[deleted]"] || [postBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
tfController = self;
|
tfController = self;
|
||||||
tfComment = nil;
|
tfComment = nil;
|
||||||
shouldHaveUndeleteAction = YES;
|
shouldHaveUndeleteAction = YES;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
%orig;
|
%orig;
|
||||||
|
|
||||||
@ -192,13 +196,15 @@ void getUndeleteCommentData(id controller, id comment){
|
|||||||
-(void) swipeCell:(id) arg1 didEndDragWithState:(NSUInteger) arg2{
|
-(void) swipeCell:(id) arg1 didEndDragWithState:(NSUInteger) arg2{
|
||||||
|
|
||||||
if (arg2 == 2){
|
if (arg2 == 2){
|
||||||
|
|
||||||
if ([arg1 isKindOfClass:[%c(NRTCommentTableViewCell) class]]) {
|
if ([arg1 isKindOfClass:[%c(NRTCommentTableViewCell) class]]) {
|
||||||
|
|
||||||
|
NSString *commentBody = MSHookIvar<NSString*>([arg1 comment], "_body");
|
||||||
|
|
||||||
|
if ((isTFDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
tfComment = [arg1 comment];
|
tfComment = [arg1 comment];
|
||||||
tfController = self;
|
tfController = self;
|
||||||
shouldHaveUndeleteAction = YES;
|
shouldHaveUndeleteAction = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,6 +229,12 @@ static void loadPrefs(){
|
|||||||
isNarwhalEnabled = YES;
|
isNarwhalEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([prefs objectForKey:@"isTFDeletedOnly"] != nil) {
|
||||||
|
isTFDeletedOnly = [[prefs objectForKey:@"isTFDeletedOnly"] boolValue];
|
||||||
|
} else {
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
||||||
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
||||||
} else {
|
} else {
|
||||||
@ -231,6 +243,7 @@ static void loadPrefs(){
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
isNarwhalEnabled = YES;
|
isNarwhalEnabled = YES;
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -254,4 +267,3 @@ static void prefsChanged(CFNotificationCenterRef center, void *observer, CFStrin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
#import "Reddit.h"
|
#import "Reddit.h"
|
||||||
|
|
||||||
static CGFloat pushshiftRequestTimeoutValue;
|
|
||||||
static BOOL isRedditEnabled;
|
static BOOL isRedditEnabled;
|
||||||
|
static BOOL isTFDeletedOnly;
|
||||||
|
static CGFloat pushshiftRequestTimeoutValue;
|
||||||
|
|
||||||
static NSArray *redditVersion;
|
static NSArray *redditVersion;
|
||||||
|
|
||||||
@ -47,6 +48,10 @@ static NSArray *redditVersion;
|
|||||||
|
|
||||||
-(void) setItems:(id) arg1{
|
-(void) setItems:(id) arg1{
|
||||||
|
|
||||||
|
NSString *commentBody = [[self comment] bodyText];
|
||||||
|
|
||||||
|
if ((isTFDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
|
|
||||||
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
||||||
|
|
||||||
CGSize existingImageSize = [[arg1[0] leftIconImage] size];
|
CGSize existingImageSize = [[arg1[0] leftIconImage] size];
|
||||||
@ -56,10 +61,12 @@ static NSArray *redditVersion;
|
|||||||
|
|
||||||
id undeleteItem = [[%c(RUIActionSheetItem) alloc] initWithLeftIconImage:newImage text:@"TF did that say?" identifier:@"undeleteItemIdentifier" context:[self comment]];
|
id undeleteItem = [[%c(RUIActionSheetItem) alloc] initWithLeftIconImage:newImage text:@"TF did that say?" identifier:@"undeleteItemIdentifier" context:[self comment]];
|
||||||
|
|
||||||
%orig([arg1 arrayByAddingObject:undeleteItem]);
|
arg1 = [arg1 arrayByAddingObject:undeleteItem];
|
||||||
|
|
||||||
[undeleteItem release];
|
[undeleteItem release];
|
||||||
|
}
|
||||||
|
|
||||||
|
%orig;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void) handleDidSelectActionSheetItem:(id) arg1{
|
-(void) handleDidSelectActionSheetItem:(id) arg1{
|
||||||
@ -185,8 +192,10 @@ static NSArray *redditVersion;
|
|||||||
-(void) setItems:(id) arg1{
|
-(void) setItems:(id) arg1{
|
||||||
|
|
||||||
Post *post = [self post];
|
Post *post = [self post];
|
||||||
|
NSString *postBody = [post selfText];
|
||||||
|
|
||||||
if ([post isSelfPost]){
|
if ([post isSelfPost]){
|
||||||
|
if ((isTFDeletedOnly && ([postBody isEqualToString:@"[deleted]"] || [postBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
|
|
||||||
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
||||||
|
|
||||||
@ -201,6 +210,7 @@ static NSArray *redditVersion;
|
|||||||
|
|
||||||
[undeleteItem release];
|
[undeleteItem release];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
%orig;
|
%orig;
|
||||||
}
|
}
|
||||||
@ -343,6 +353,10 @@ static NSArray *redditVersion;
|
|||||||
|
|
||||||
-(void) setItems:(id) arg1{
|
-(void) setItems:(id) arg1{
|
||||||
|
|
||||||
|
NSString *commentBody = [[self comment] bodyText];
|
||||||
|
|
||||||
|
if ((isTFDeletedOnly && ([commentBody isEqualToString:@"[deleted]"] || [commentBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
|
|
||||||
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
||||||
|
|
||||||
CGSize existingImageSize = [[arg1[0] leftIconImage] size];
|
CGSize existingImageSize = [[arg1[0] leftIconImage] size];
|
||||||
@ -358,11 +372,14 @@ static NSArray *redditVersion;
|
|||||||
undeleteItem = [[%c(ActionSheetItem) alloc] initWithLeftIconImage:newImage text:@"TF did that say?" identifier:@"undeleteItemIdentifier" context:[self comment]];
|
undeleteItem = [[%c(ActionSheetItem) alloc] initWithLeftIconImage:newImage text:@"TF did that say?" identifier:@"undeleteItemIdentifier" context:[self comment]];
|
||||||
}
|
}
|
||||||
|
|
||||||
%orig([arg1 arrayByAddingObject:undeleteItem]);
|
arg1 = [arg1 arrayByAddingObject:undeleteItem];
|
||||||
|
|
||||||
[undeleteItem release];
|
[undeleteItem release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%orig;
|
||||||
|
}
|
||||||
|
|
||||||
// >= 4.21
|
// >= 4.21
|
||||||
-(void) handleDidSelectActionSheetItem:(id) arg1{
|
-(void) handleDidSelectActionSheetItem:(id) arg1{
|
||||||
%orig;
|
%orig;
|
||||||
@ -479,8 +496,10 @@ static NSArray *redditVersion;
|
|||||||
-(void) setItems:(id) arg1{
|
-(void) setItems:(id) arg1{
|
||||||
|
|
||||||
Post *post = [self post];
|
Post *post = [self post];
|
||||||
|
NSString *postBody = [post selfText];
|
||||||
|
|
||||||
if ([post isSelfPost]){
|
if ([post isSelfPost]){
|
||||||
|
if ((isTFDeletedOnly && ([postBody isEqualToString:@"[deleted]"] || [postBody isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
|
|
||||||
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
UIImage* origImage = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/TFDidThatSay/eye160dark.png"];
|
||||||
|
|
||||||
@ -501,6 +520,7 @@ static NSArray *redditVersion;
|
|||||||
|
|
||||||
[undeleteItem release];
|
[undeleteItem release];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
%orig;
|
%orig;
|
||||||
}
|
}
|
||||||
@ -722,6 +742,12 @@ static void loadPrefs(){
|
|||||||
isRedditEnabled = YES;
|
isRedditEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([prefs objectForKey:@"isTFDeletedOnly"] != nil) {
|
||||||
|
isTFDeletedOnly = [[prefs objectForKey:@"isTFDeletedOnly"] boolValue];
|
||||||
|
} else {
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
||||||
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
pushshiftRequestTimeoutValue = [[prefs objectForKey:@"requestTimeoutValue"] doubleValue];
|
||||||
} else {
|
} else {
|
||||||
@ -730,6 +756,7 @@ static void loadPrefs(){
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
isRedditEnabled = YES;
|
isRedditEnabled = YES;
|
||||||
|
isTFDeletedOnly = YES;
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#import "assets/MMMarkdown.h"
|
#import "assets/MMMarkdown.h"
|
||||||
|
|
||||||
static BOOL isSlideEnabled;
|
static BOOL isSlideEnabled;
|
||||||
static BOOL isSlideDeletedOnly;
|
static BOOL isTFDeletedOnly;
|
||||||
static CGFloat pushshiftRequestTimeoutValue;
|
static CGFloat pushshiftRequestTimeoutValue;
|
||||||
|
|
||||||
%group Slide
|
%group Slide
|
||||||
@ -266,7 +266,7 @@ static UIButton * createUndeleteButton(){
|
|||||||
|
|
||||||
NSString *body = [MSHookIvar<id>(self, "comment") body];
|
NSString *body = [MSHookIvar<id>(self, "comment") body];
|
||||||
|
|
||||||
if ((isSlideDeletedOnly && ([body isEqualToString:@"[deleted]"] || [body isEqualToString:@"[removed]"])) || !isSlideDeletedOnly){
|
if ((isTFDeletedOnly && ([body isEqualToString:@"[deleted]"] || [body isEqualToString:@"[removed]"])) || !isTFDeletedOnly){
|
||||||
|
|
||||||
id controller = MSHookIvar<id>(self, "parent");
|
id controller = MSHookIvar<id>(self, "parent");
|
||||||
|
|
||||||
@ -339,9 +339,9 @@ static UIButton * createUndeleteButton(){
|
|||||||
NSMutableAttributedString *htmlAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:[dthtmlBuilder generatedAttributedString]];
|
NSMutableAttributedString *htmlAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:[dthtmlBuilder generatedAttributedString]];
|
||||||
NSRange htmlStringRange = NSMakeRange(0, [htmlAttributedString length]);
|
NSRange htmlStringRange = NSMakeRange(0, [htmlAttributedString length]);
|
||||||
|
|
||||||
[[htmlAttributedString mutableString] replaceOccurrencesOfString:@"\t•\t" withString:@" • " options:nil range: htmlStringRange];
|
[[htmlAttributedString mutableString] replaceOccurrencesOfString:@"\t•\t" withString:@" • " options:0 range: htmlStringRange];
|
||||||
[[htmlAttributedString mutableString] replaceOccurrencesOfString:@"\t◦\t" withString:@" ◦ " options:nil range: htmlStringRange];
|
[[htmlAttributedString mutableString] replaceOccurrencesOfString:@"\t◦\t" withString:@" ◦ " options:0 range: htmlStringRange];
|
||||||
[[htmlAttributedString mutableString] replaceOccurrencesOfString:@"\t▪\t" withString:@" ▪ " options:nil range: htmlStringRange];
|
[[htmlAttributedString mutableString] replaceOccurrencesOfString:@"\t▪\t" withString:@" ▪ " options:0 range: htmlStringRange];
|
||||||
|
|
||||||
[htmlAttributedString removeAttribute:@"CTForegroundColorFromContext" range:htmlStringRange];
|
[htmlAttributedString removeAttribute:@"CTForegroundColorFromContext" range:htmlStringRange];
|
||||||
|
|
||||||
@ -376,7 +376,7 @@ static UIButton * createUndeleteButton(){
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
[htmlAttributedString beginEditing];
|
[htmlAttributedString beginEditing];
|
||||||
[htmlAttributedString enumerateAttribute:NSFontAttributeName inRange:NSMakeRange(0, [htmlAttributedString length]) options:nil usingBlock:^(id value, NSRange range, BOOL *stop){
|
[htmlAttributedString enumerateAttribute:NSFontAttributeName inRange:NSMakeRange(0, [htmlAttributedString length]) options:0 usingBlock:^(id value, NSRange range, BOOL *stop){
|
||||||
|
|
||||||
UIFont *attrFont = (UIFont *)value;
|
UIFont *attrFont = (UIFont *)value;
|
||||||
|
|
||||||
@ -429,10 +429,10 @@ static void loadPrefs(){
|
|||||||
isSlideEnabled = YES;
|
isSlideEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"isSlideDeletedOnly"] != nil){
|
if ([prefs objectForKey:@"isTFDeletedOnly"] != nil){
|
||||||
isSlideDeletedOnly = [[prefs objectForKey:@"isSlideDeletedOnly"] boolValue];
|
isTFDeletedOnly = [[prefs objectForKey:@"isTFDeletedOnly"] boolValue];
|
||||||
} else {
|
} else {
|
||||||
isSlideDeletedOnly = YES;
|
isTFDeletedOnly = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
if ([prefs objectForKey:@"requestTimeoutValue"] != nil){
|
||||||
@ -443,7 +443,7 @@ static void loadPrefs(){
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
isSlideEnabled = YES;
|
isSlideEnabled = YES;
|
||||||
isSlideDeletedOnly = YES;
|
isTFDeletedOnly = YES;
|
||||||
pushshiftRequestTimeoutValue = 10;
|
pushshiftRequestTimeoutValue = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user