From 48c9597a01b05b23818692a91f2f27d87f2a492b Mon Sep 17 00:00:00 2001 From: lint <47455468+lint@users.noreply.github.com> Date: Mon, 8 Jun 2020 10:19:04 -0400 Subject: [PATCH] Fix language bug for all supported apps --- tweak/AlienBlue.xm | 8 ++++---- tweak/Antenna.xm | 8 ++++---- tweak/Apollo.xm | 32 +++++++++++++++----------------- tweak/BaconReader.xm | 8 ++++---- tweak/Beam.xm | 8 ++++---- tweak/Narwhal.xm | 12 ++++++------ tweak/Reddit.xm | 16 ++++++++-------- tweak/Slide.xm | 8 ++++---- 8 files changed, 49 insertions(+), 51 deletions(-) diff --git a/tweak/AlienBlue.xm b/tweak/AlienBlue.xm index 943842e..3fb4545 100644 --- a/tweak/AlienBlue.xm +++ b/tweak/AlienBlue.xm @@ -15,15 +15,15 @@ static CGFloat pushshiftRequestTimeoutValue; - (id)initWithNode:(id)arg1 { id orig = %orig; - NSString *body; + NSString *author; if ([self isPostHeader]) { - body = [[arg1 post] selftext]; + author = [[arg1 post] author]; } 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; diff --git a/tweak/Antenna.xm b/tweak/Antenna.xm index 93c2f2d..9ff8e30 100644 --- a/tweak/Antenna.xm +++ b/tweak/Antenna.xm @@ -34,9 +34,9 @@ id tfAntennaCommentCell; - (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; tfAntennaCommentCell = arg1; shouldHaveAntennaUndeleteAction = YES; @@ -113,10 +113,10 @@ id tfAntennaCommentCell; BOOL isAbleToUndeletePost = NO; id post = [[self delegate] postInternal]; - NSString *postBody = [[post selfCommentText] body]; + NSString *author = [post author]; if ([post isSelfPost]){ - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]){ + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ isAbleToUndeletePost = YES; NSMutableArray *barButtons = [self defaultHeaderButtons]; diff --git a/tweak/Apollo.xm b/tweak/Apollo.xm index ce4ba67..986c2e2 100644 --- a/tweak/Apollo.xm +++ b/tweak/Apollo.xm @@ -186,9 +186,9 @@ id apolloCommentsControllerForContext; if (!shouldApolloHaveButton){ - NSString *commentBody = [MSHookIvar(self, "comment") body]; + NSString *author = [MSHookIvar(self, "comment") author]; - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { shouldAddUndeleteCell = YES; apolloCommentCell = self; apolloCommentController = nil; @@ -202,9 +202,9 @@ id apolloCommentsControllerForContext; if (!shouldApolloHaveButton){ - NSString *commentBody = [MSHookIvar(self, "comment") body]; + NSString *author = [MSHookIvar(self, "comment") author]; - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { shouldAddUndeleteCell = YES; apolloCommentCell = self; apolloCommentController = nil; @@ -217,13 +217,11 @@ id apolloCommentsControllerForContext; - (void)didLoad { %orig; - //HBLogDebug(@"didLoad - actionDelegate:%@", MSHookIvar(self, "actionDelegate")); + if (shouldApolloHaveButton) { - if (shouldApolloHaveButton){ + NSString *author = [MSHookIvar(self, "comment") author]; - NSString *commentBody = [MSHookIvar(self, "comment") body]; - - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { CGFloat imageSize = 20.0f; @@ -317,10 +315,10 @@ id apolloCommentsControllerForContext; - (void)moreOptionsBarButtonItemTappedWithSender:(id)arg1 { RKLink *post = MSHookIvar(self, "link"); - NSString *postBody = [post selfText]; + NSString *author = [post author]; if ([post isSelfPost]) { - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { shouldAddUndeleteCell = YES; apolloCommentCell = nil; apolloCommentController = self; @@ -383,10 +381,10 @@ id apolloCommentsControllerForContext; - (void)longPressedWithGestureRecognizer:(id)arg1 { RKLink *post = MSHookIvar(self, "link"); - NSString *postBody = [post selfText]; + NSString *author = [post author]; if ([post isSelfPost]) { - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]){ + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]){ shouldAddUndeleteCell = YES; apolloCommentCell = nil; apolloCommentController = self; @@ -433,9 +431,9 @@ id apolloCommentsControllerForContext; if (!shouldApolloHaveButton) { - NSString *commentBody = [MSHookIvar(self, "comment") body]; + NSString *author = [MSHookIvar(self, "comment") author]; - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { shouldAddUndeleteCellForContext = YES; apolloCommentCellForContext = [self commentCellNode]; apolloCommentsControllerForContext = nil; @@ -463,10 +461,10 @@ id apolloCommentsControllerForContext; id commentsController = MSHookIvar(self, "viewController"); RKLink *post = MSHookIvar(commentsController, "link"); - NSString *postBody = [post selfText]; + NSString *author = [post author]; if ([post isSelfPost]) { - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:postBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { shouldAddUndeleteCellForContext = YES; apolloCommentCellForContext = nil; apolloCommentsControllerForContext = commentsController; diff --git a/tweak/BaconReader.xm b/tweak/BaconReader.xm index e396877..a155c68 100644 --- a/tweak/BaconReader.xm +++ b/tweak/BaconReader.xm @@ -93,9 +93,9 @@ id tfStoryController; - (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; tfCommentCellView = arg1; tfStoryController = self; @@ -110,9 +110,9 @@ id tfStoryController; - (void)menuTouchedWithSender:(id)arg1 { 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; tfCommentCellView = nil; tfStoryController = self; diff --git a/tweak/Beam.xm b/tweak/Beam.xm index 6521643..224eea8 100644 --- a/tweak/Beam.xm +++ b/tweak/Beam.xm @@ -25,9 +25,9 @@ static CGFloat pushshiftRequestTimeoutValue; } } 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; @@ -113,9 +113,9 @@ static CGFloat pushshiftRequestTimeoutValue; if (![self undeleteButton] && [[[self post] isSelfText] boolValue] && [MSHookIvar(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(self, "moreButton"); diff --git a/tweak/Narwhal.xm b/tweak/Narwhal.xm index 0d72085..6bd1c48 100644 --- a/tweak/Narwhal.xm +++ b/tweak/Narwhal.xm @@ -48,9 +48,9 @@ void getUndeleteCommentData(id controller, id comment){ if (arg2 == 2) { if ([arg1 isKindOfClass:[%c(NRTCommentTableViewCell) class]]) { - NSString *commentBody = MSHookIvar([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]; tfController = self; shouldHaveUndeleteAction = YES; @@ -67,9 +67,9 @@ void getUndeleteCommentData(id controller, id comment){ 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; tfComment = nil; shouldHaveUndeleteAction = YES; @@ -126,9 +126,9 @@ void getUndeleteCommentData(id controller, id comment){ if (arg2 == 2) { if ([arg1 isKindOfClass:[%c(NRTCommentTableViewCell) class]]) { - NSString *commentBody = MSHookIvar([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]; tfController = self; shouldHaveUndeleteAction = YES; diff --git a/tweak/Reddit.xm b/tweak/Reddit.xm index ec34bb9..b8f3fce 100644 --- a/tweak/Reddit.xm +++ b/tweak/Reddit.xm @@ -51,9 +51,9 @@ int secondVersionPart = 0; - (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"]; @@ -206,10 +206,10 @@ int secondVersionPart = 0; - (void)setItems:(id)arg1 { Post *post = [self post]; - NSString *postBody = [post selfText]; + NSString *author = [post author]; 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"]; @@ -366,9 +366,9 @@ int secondVersionPart = 0; - (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"]; @@ -450,10 +450,10 @@ int secondVersionPart = 0; - (void)setItems:(id)arg1{ Post *post = [self post]; - NSString *postBody = [post selfText]; + NSString *author = [post author]; 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"]; diff --git a/tweak/Slide.xm b/tweak/Slide.xm index c08cefc..5be3183 100644 --- a/tweak/Slide.xm +++ b/tweak/Slide.xm @@ -265,9 +265,9 @@ static UIButton *createUndeleteButton(){ %new - (void)addUndeleteButtonToMenu { - NSString *commentBody = [MSHookIvar(self, "comment") body]; + NSString *author = [MSHookIvar(self, "comment") author]; - if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:commentBody isDeletedOnly:isTFDeletedOnly]) { + if ([%c(TFHelper) shouldShowUndeleteButtonWithInfo:author isDeletedOnly:isTFDeletedOnly]) { id controller = MSHookIvar(self, "parent"); @@ -464,9 +464,9 @@ static UIButton *createUndeleteButton(){ 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; } }