mirror of
https://github.com/lint/TFDidThatSay
synced 2025-07-01 15:36:46 +00:00
Add helper method
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user