|
|
|
|
|
|
|
|
|
|
|
|
|
|
%group AlienBlue |
|
|
%group AlienBlue |
|
|
|
|
|
|
|
|
%hook NCommentCell |
|
|
|
|
|
|
|
|
|
|
|
-(void) setDrawerView:(id) arg1 { |
|
|
|
|
|
[arg1 setComment:[self comment]]; |
|
|
|
|
|
%orig; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
%end |
|
|
|
|
|
|
|
|
|
|
|
%hook NCommentPostHeaderCell |
|
|
|
|
|
|
|
|
|
|
|
-(void) setDrawerView:(id) arg1 { |
|
|
|
|
|
[arg1 setPost:[self post]]; |
|
|
|
|
|
[arg1 setCommentNode:[self node]]; |
|
|
|
|
|
%orig; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
%end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%hook CommentOptionsDrawerView |
|
|
%hook CommentOptionsDrawerView |
|
|
%property(strong, nonatomic) Comment *comment; |
|
|
|
|
|
%property(strong, nonatomic) Post *post; |
|
|
|
|
|
%property(strong, nonatomic) CommentPostHeaderNode *commentNode; |
|
|
|
|
|
|
|
|
|
|
|
-(id) initWithNode:(id) arg1 { |
|
|
-(id) initWithNode:(id) arg1 { |
|
|
id orig = %orig; |
|
|
id orig = %orig; |
|
|
|
|
|
|
|
|
NSString *body; |
|
|
NSString *body; |
|
|
|
|
|
|
|
|
if ([self post]) { |
|
|
|
|
|
body = [[self post] selftext]; |
|
|
|
|
|
} else if ([self comment]){ |
|
|
|
|
|
body = [[self comment] body]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ([self isPostHeader]) { |
|
|
|
|
|
body = [[arg1 post] selftext]; |
|
|
|
|
|
} else { |
|
|
|
|
|
body = [[(CommentNode *)arg1 comment] body]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ((isAlienBlueDeletedOnly && ([body isEqualToString:@"[deleted]"] || [body isEqualToString:@"[removed]"])) || !isAlienBlueDeletedOnly) { |
|
|
if ((isAlienBlueDeletedOnly && ([body isEqualToString:@"[deleted]"] || [body isEqualToString:@"[removed]"])) || !isAlienBlueDeletedOnly) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[undeleteButton setFrame:CGRectMake(0, 0, refSize.width, refSize.height)]; |
|
|
[undeleteButton setFrame:CGRectMake(0, 0, refSize.width, refSize.height)]; |
|
|
|
|
|
|
|
|
if ([self isPostHeader]){ |
|
|
if ([self isPostHeader]){ |
|
|
[undeleteButton addTarget:self action:@selector(didTapPostUndeleteButton) forControlEvents:UIControlEventTouchUpInside]; |
|
|
|
|
|
|
|
|
[undeleteButton addTarget:self action:@selector(didTapPostUndeleteButton:) forControlEvents:UIControlEventTouchUpInside]; |
|
|
} else { |
|
|
} else { |
|
|
[undeleteButton addTarget:self action:@selector(didTapCommentUndeleteButton) forControlEvents:UIControlEventTouchUpInside]; |
|
|
|
|
|
|
|
|
[undeleteButton addTarget:self action:@selector(didTapCommentUndeleteButton:) forControlEvents:UIControlEventTouchUpInside]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ([%c(Resources) isNight]) { |
|
|
if ([%c(Resources) isNight]) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return orig; |
|
|
return orig; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%new |
|
|
%new |
|
|
-(void) didTapCommentUndeleteButton { |
|
|
|
|
|
|
|
|
-(void) didTapCommentUndeleteButton:(id) sender { |
|
|
|
|
|
|
|
|
|
|
|
[sender setEnabled:NO]; |
|
|
|
|
|
|
|
|
Comment *comment = [self comment]; |
|
|
|
|
|
|
|
|
id comment = [[self node] comment]; |
|
|
|
|
|
|
|
|
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; |
|
|
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; |
|
|
NSOperationQueue *queue = [[NSOperationQueue alloc] init]; |
|
|
NSOperationQueue *queue = [[NSOperationQueue alloc] init]; |
|
|
|
|
|
|
|
|
[comment setBodyHTML:bodyHTML]; |
|
|
[comment setBodyHTML:bodyHTML]; |
|
|
|
|
|
|
|
|
[[self delegate] performSelectorOnMainThread:@selector(respondToStyleChange) withObject:nil waitUntilDone:NO]; |
|
|
[[self delegate] performSelectorOnMainThread:@selector(respondToStyleChange) withObject:nil waitUntilDone:NO]; |
|
|
|
|
|
|
|
|
|
|
|
[sender setEnabled:YES]; |
|
|
}]; |
|
|
}]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%new |
|
|
%new |
|
|
-(void) didTapPostUndeleteButton { |
|
|
|
|
|
|
|
|
-(void) didTapPostUndeleteButton:(id) sender { |
|
|
|
|
|
|
|
|
|
|
|
[sender setEnabled:NO]; |
|
|
|
|
|
|
|
|
Post *post = [self post]; |
|
|
|
|
|
Comment *postComment = [[self commentNode] comment]; //Don't know why he used a comment to store info about a post, but it exists |
|
|
|
|
|
|
|
|
id post = [[self node] post]; |
|
|
|
|
|
id postComment = [[self node] comment]; //Don't know why he used a comment to store info about a post, but it exists |
|
|
|
|
|
|
|
|
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; |
|
|
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; |
|
|
NSOperationQueue *queue = [[NSOperationQueue alloc] init]; |
|
|
NSOperationQueue *queue = [[NSOperationQueue alloc] init]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[self delegate] performSelectorOnMainThread:@selector(respondToStyleChange) withObject:nil waitUntilDone:NO]; |
|
|
[[self delegate] performSelectorOnMainThread:@selector(respondToStyleChange) withObject:nil waitUntilDone:NO]; |
|
|
|
|
|
|
|
|
|
|
|
[sender setEnabled:YES]; |
|
|
}]; |
|
|
}]; |
|
|
} |
|
|
} |
|
|
|
|
|
|