Fix language bug for all supported apps

This commit is contained in:
lint
2020-06-08 10:19:04 -04:00
parent 7cb51bae07
commit 48c9597a01
8 changed files with 49 additions and 51 deletions

View File

@ -15,15 +15,15 @@ static CGFloat pushshiftRequestTimeoutValue;
- (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;

View File

@ -34,9 +34,9 @@ id tfAntennaCommentCell;
- (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;
@ -113,10 +113,10 @@ id tfAntennaCommentCell;
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];

View File

@ -186,9 +186,9 @@ id apolloCommentsControllerForContext;
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;
@ -202,9 +202,9 @@ id apolloCommentsControllerForContext;
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;
@ -217,13 +217,11 @@ id apolloCommentsControllerForContext;
- (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;
@ -317,10 +315,10 @@ id apolloCommentsControllerForContext;
- (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;
@ -383,10 +381,10 @@ id apolloCommentsControllerForContext;
- (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;
@ -433,9 +431,9 @@ id apolloCommentsControllerForContext;
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;
@ -463,10 +461,10 @@ id apolloCommentsControllerForContext;
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;

View File

@ -93,9 +93,9 @@ id tfStoryController;
- (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;
@ -110,9 +110,9 @@ id tfStoryController;
- (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;

View File

@ -25,9 +25,9 @@ static CGFloat pushshiftRequestTimeoutValue;
} }
} 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;
@ -113,9 +113,9 @@ static CGFloat pushshiftRequestTimeoutValue;
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");

View File

@ -48,9 +48,9 @@ void getUndeleteCommentData(id controller, id comment){
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;
@ -67,9 +67,9 @@ void getUndeleteCommentData(id controller, id comment){
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;
@ -126,9 +126,9 @@ void getUndeleteCommentData(id controller, id comment){
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;

View File

@ -51,9 +51,9 @@ int secondVersionPart = 0;
- (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"];
@ -206,10 +206,10 @@ int secondVersionPart = 0;
- (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"];
@ -366,9 +366,9 @@ int secondVersionPart = 0;
- (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"];
@ -450,10 +450,10 @@ int secondVersionPart = 0;
- (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"];

View File

@ -265,9 +265,9 @@ static UIButton *createUndeleteButton(){
%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");
@ -464,9 +464,9 @@ static UIButton *createUndeleteButton(){
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;
} }
} }