- (id)initWithNode:(id)arg1 { | - (id)initWithNode:(id)arg1 { | ||||
id orig = %orig; | id orig = %orig; | ||||
NSString *body; | |||||
NSString *author; | |||||
if ([self isPostHeader]) { | if ([self isPostHeader]) { | ||||
body = [[arg1 post] selftext]; | |||||
author = [[arg1 post] author]; | |||||
} else { | } else { | ||||
body = [[(CommentNode *)arg1 comment] body]; | |||||
author = [[(CommentNode *)arg1 comment] author]; | |||||
} | } | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:body isDeletedOnly:isTFDeletedOnly]){ | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ | |||||
CGSize refSize = [[self buttons][0] frame].size; | CGSize refSize = [[self buttons][0] frame].size; | ||||
- (void)didLongPressCell:(id)arg1 gesture:(id)arg2 { | - (void)didLongPressCell:(id)arg1 gesture:(id)arg2 { | ||||
NSString *commentBody = [[[arg1 comment] commentText] body]; | |||||
NSString *author = [[arg1 comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]){ | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ | |||||
tfAntennaController = self; | tfAntennaController = self; | ||||
tfAntennaCommentCell = arg1; | tfAntennaCommentCell = arg1; | ||||
shouldHaveAntennaUndeleteAction = YES; | shouldHaveAntennaUndeleteAction = YES; | ||||
BOOL isAbleToUndeletePost = NO; | BOOL isAbleToUndeletePost = NO; | ||||
id post = [[self delegate] postInternal]; | id post = [[self delegate] postInternal]; | ||||
NSString *postBody = [[post selfCommentText] body]; | |||||
NSString *author = [post author]; | |||||
if ([post isSelfPost]){ | if ([post isSelfPost]){ | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]){ | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ | |||||
isAbleToUndeletePost = YES; | isAbleToUndeletePost = YES; | ||||
NSMutableArray *barButtons = [self defaultHeaderButtons]; | NSMutableArray *barButtons = [self defaultHeaderButtons]; |
if (!shouldApolloHaveButton){ | if (!shouldApolloHaveButton){ | ||||
NSString *commentBody = [MSHookIvar<RKComment *>(self, "comment") body]; | |||||
NSString *author = [MSHookIvar<RKComment *>(self, "comment") author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldAddUndeleteCell = YES; | shouldAddUndeleteCell = YES; | ||||
apolloCommentCell = self; | apolloCommentCell = self; | ||||
apolloCommentController = nil; | apolloCommentController = nil; | ||||
if (!shouldApolloHaveButton){ | if (!shouldApolloHaveButton){ | ||||
NSString *commentBody = [MSHookIvar<RKComment *>(self, "comment") body]; | |||||
NSString *author = [MSHookIvar<RKComment *>(self, "comment") author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldAddUndeleteCell = YES; | shouldAddUndeleteCell = YES; | ||||
apolloCommentCell = self; | apolloCommentCell = self; | ||||
apolloCommentController = nil; | apolloCommentController = nil; | ||||
- (void)didLoad { | - (void)didLoad { | ||||
%orig; | %orig; | ||||
//HBLogDebug(@"didLoad - actionDelegate:%@", MSHookIvar<id>(self, "actionDelegate")); | |||||
if (shouldApolloHaveButton){ | |||||
if (shouldApolloHaveButton) { | |||||
NSString *commentBody = [MSHookIvar<RKComment *>(self, "comment") body]; | |||||
NSString *author = [MSHookIvar<RKComment *>(self, "comment") author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
CGFloat imageSize = 20.0f; | CGFloat imageSize = 20.0f; | ||||
- (void)moreOptionsBarButtonItemTappedWithSender:(id)arg1 { | - (void)moreOptionsBarButtonItemTappedWithSender:(id)arg1 { | ||||
RKLink *post = MSHookIvar<RKLink *>(self, "link"); | RKLink *post = MSHookIvar<RKLink *>(self, "link"); | ||||
NSString *postBody = [post selfText]; | |||||
NSString *author = [post author]; | |||||
if ([post isSelfPost]) { | if ([post isSelfPost]) { | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldAddUndeleteCell = YES; | shouldAddUndeleteCell = YES; | ||||
apolloCommentCell = nil; | apolloCommentCell = nil; | ||||
apolloCommentController = self; | apolloCommentController = self; | ||||
- (void)longPressedWithGestureRecognizer:(id)arg1 { | - (void)longPressedWithGestureRecognizer:(id)arg1 { | ||||
RKLink *post = MSHookIvar<RKLink *>(self, "link"); | RKLink *post = MSHookIvar<RKLink *>(self, "link"); | ||||
NSString *postBody = [post selfText]; | |||||
NSString *author = [post author]; | |||||
if ([post isSelfPost]) { | if ([post isSelfPost]) { | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]){ | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ | |||||
shouldAddUndeleteCell = YES; | shouldAddUndeleteCell = YES; | ||||
apolloCommentCell = nil; | apolloCommentCell = nil; | ||||
apolloCommentController = self; | apolloCommentController = self; | ||||
if (!shouldApolloHaveButton) { | if (!shouldApolloHaveButton) { | ||||
NSString *commentBody = [MSHookIvar<RKComment *>(self, "comment") body]; | |||||
NSString *author = [MSHookIvar<RKComment *>(self, "comment") author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldAddUndeleteCellForContext = YES; | shouldAddUndeleteCellForContext = YES; | ||||
apolloCommentCellForContext = [self commentCellNode]; | apolloCommentCellForContext = [self commentCellNode]; | ||||
apolloCommentsControllerForContext = nil; | apolloCommentsControllerForContext = nil; | ||||
id commentsController = MSHookIvar<id>(self, "viewController"); | id commentsController = MSHookIvar<id>(self, "viewController"); | ||||
RKLink *post = MSHookIvar<RKLink *>(commentsController, "link"); | RKLink *post = MSHookIvar<RKLink *>(commentsController, "link"); | ||||
NSString *postBody = [post selfText]; | |||||
NSString *author = [post author]; | |||||
if ([post isSelfPost]) { | if ([post isSelfPost]) { | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldAddUndeleteCellForContext = YES; | shouldAddUndeleteCellForContext = YES; | ||||
apolloCommentCellForContext = nil; | apolloCommentCellForContext = nil; | ||||
apolloCommentsControllerForContext = commentsController; | apolloCommentsControllerForContext = commentsController; |
- (void)showMoreCommentActions:(id)arg1 showAll:(BOOL)arg2 { | - (void)showMoreCommentActions:(id)arg1 showAll:(BOOL)arg2 { | ||||
NSString *commentBody = [[arg1 comment] body]; | |||||
NSString *author = [[arg1 comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldHaveBRUndeleteAction = YES; | shouldHaveBRUndeleteAction = YES; | ||||
tfCommentCellView = arg1; | tfCommentCellView = arg1; | ||||
tfStoryController = self; | tfStoryController = self; | ||||
- (void)menuTouchedWithSender:(id)arg1 { | - (void)menuTouchedWithSender:(id)arg1 { | ||||
if ([[self story] is_selfValue]) { | if ([[self story] is_selfValue]) { | ||||
NSString *postBody = [[self story] selftext]; | |||||
NSString *author = [[self story] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
shouldHaveBRUndeleteAction = YES; | shouldHaveBRUndeleteAction = YES; | ||||
tfCommentCellView = nil; | tfCommentCellView = nil; | ||||
tfStoryController = self; | tfStoryController = self; |
} | } | ||||
} else { | } else { | ||||
NSString *commentBody = [[self comment] content]; | |||||
NSString *author = [[self comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
CGFloat authorTextHeight = [[self authorButton] frame].size.height; | CGFloat authorTextHeight = [[self authorButton] frame].size.height; | ||||
if (![self undeleteButton] && [[[self post] isSelfText] boolValue] && [MSHookIvar<id>(self, "delegate") isMemberOfClass:objc_getClass("beam.PostDetailEmbeddedViewController")]) { | if (![self undeleteButton] && [[[self post] isSelfText] boolValue] && [MSHookIvar<id>(self, "delegate") isMemberOfClass:objc_getClass("beam.PostDetailEmbeddedViewController")]) { | ||||
NSString *postBody = [[self post] content]; | |||||
NSString *author = [[self post] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
id moreButton = MSHookIvar<id>(self, "moreButton"); | id moreButton = MSHookIvar<id>(self, "moreButton"); | ||||
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"); | |||||
NSString *author = [[arg1 comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]){ | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ | |||||
tfComment = [arg1 comment]; | tfComment = [arg1 comment]; | ||||
tfController = self; | tfController = self; | ||||
shouldHaveUndeleteAction = YES; | shouldHaveUndeleteAction = YES; | ||||
if ([self linkTextOffscreenCell]) { | if ([self linkTextOffscreenCell]) { | ||||
NSString *postBody = [[self link] selfText]; | |||||
NSString *author = [[self link] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
tfController = self; | tfController = self; | ||||
tfComment = nil; | tfComment = nil; | ||||
shouldHaveUndeleteAction = YES; | shouldHaveUndeleteAction = YES; | ||||
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"); | |||||
NSString *author = [[arg1 comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
tfComment = [arg1 comment]; | tfComment = [arg1 comment]; | ||||
tfController = self; | tfController = self; | ||||
shouldHaveUndeleteAction = YES; | shouldHaveUndeleteAction = YES; |
- (void)setItems:(id)arg1 { | - (void)setItems:(id)arg1 { | ||||
NSString *commentAuthor = [[self comment] author]; | |||||
NSString *author = [[self comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentAuthor isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly: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"]; | ||||
- (void)setItems:(id)arg1 { | - (void)setItems:(id)arg1 { | ||||
Post *post = [self post]; | Post *post = [self post]; | ||||
NSString *postBody = [post selfText]; | |||||
NSString *author = [post author]; | |||||
if ([post isSelfPost]) { | if ([post isSelfPost]) { | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly: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"]; | ||||
- (void)setItems:(id)arg1 { | - (void)setItems:(id)arg1 { | ||||
NSString *commentAuthor = [[self comment] author]; | |||||
NSString *author = [[self comment] author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentAuthor isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly: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"]; | ||||
- (void)setItems:(id)arg1{ | - (void)setItems:(id)arg1{ | ||||
Post *post = [self post]; | Post *post = [self post]; | ||||
NSString *postBody = [post selfText]; | |||||
NSString *author = [post author]; | |||||
if ([post isSelfPost]) { | if ([post isSelfPost]) { | ||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly: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"]; | ||||
%new | %new | ||||
- (void)addUndeleteButtonToMenu { | - (void)addUndeleteButtonToMenu { | ||||
NSString *commentBody = [MSHookIvar<id>(self, "comment") body]; | |||||
NSString *author = [MSHookIvar<id>(self, "comment") author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
id controller = MSHookIvar<id>(self, "parent"); | id controller = MSHookIvar<id>(self, "parent"); | ||||
if ([post isSelf]) { | if ([post isSelf]) { | ||||
NSString *postBody = [post body]; | |||||
NSString *author = [post author]; | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { | |||||
if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { | |||||
return YES; | return YES; | ||||
} | } | ||||
} | } |