1
0
mirror of https://github.com/lint/TFDidThatSay synced 2025-07-01 15:36:46 +00:00

Add helper method

This commit is contained in:
lint
2020-01-07 21:22:07 -05:00
parent 88b54dd1a1
commit bb0d0d9e95
10 changed files with 37 additions and 21 deletions

View File

@ -2,5 +2,6 @@
@interface TFHelper : NSObject
+(void) getUndeleteDataWithID:(NSString *) ident isComment:(BOOL) isComment timeout:(CGFloat) timeout extraData:(NSDictionary *) extra completionTarget:(id) target completionSelector:(SEL) sel;
+(BOOL) shouldShowUndeleteButtonWithInfo:(NSString *) content isDeletedOnly:(BOOL) isDeletedOnly;
@end

View File

@ -47,4 +47,19 @@
}];
}
@end
+(BOOL) shouldShowUndeleteButtonWithInfo:(NSString *) content isDeletedOnly:(BOOL) isDeletedOnly{
if (!isDeletedOnly){
return YES;
} else {
if ([content isEqualToString:@"[deleted]"] || [content isEqualToString:@"[removed]"]){
return YES;
} else if ([content hasPrefix:@"[pushshift"] || [content hasPrefix:@"[an error occured"]){
return YES;
}
}
return NO;
}
@end