Merge branch 'charlesmchen/arbitraryAttachments'

pull/1/head
Matthew Chen 8 years ago
commit 1d946ccfed

@ -24,11 +24,6 @@ extern NSString *const OWSMimeTypeUnknownForTests;
+ (NSString *)getSupportedExtensionFromImageMIMEType:(NSString *)supportedMIMEType;
+ (NSString *)getSupportedExtensionFromAnimatedMIMEType:(NSString *)supportedMIMEType;
+ (NSString *)getSupportedMIMETypeFromVideoFile:(NSString *)supportedVideoFile;
+ (NSString *)getSupportedMIMETypeFromAudioFile:(NSString *)supportedAudioFile;
+ (NSString *)getSupportedMIMETypeFromImageFile:(NSString *)supportedImageFile;
+ (NSString *)getSupportedMIMETypeFromAnimatedFile:(NSString *)supportedImageFile;
+ (BOOL)isAnimated:(NSString *)contentType;
+ (BOOL)isImage:(NSString *)contentType;
+ (BOOL)isVideo:(NSString *)contentType;
@ -42,11 +37,6 @@ extern NSString *const OWSMimeTypeUnknownForTests;
+ (NSURL *)simLinkCorrectExtensionOfFile:(NSURL *)mediaURL ofMIMEType:(NSString *)contentType;
#if TARGET_OS_IPHONE
+ (NSString *)getSupportedImageMIMETypeFromImage:(UIImage *)image;
+ (BOOL)getIsSupportedTypeFromImage:(UIImage *)image;
#endif
+ (NSSet<NSString *> *)supportedVideoUTITypes;
+ (NSSet<NSString *> *)supportedAudioUTITypes;
+ (NSSet<NSString *> *)supportedImageUTITypes;

@ -237,22 +237,6 @@ NSString *const OWSMimeTypeUnknownForTests = @"unknown/mimetype";
return [[self supportedBinaryDataMIMETypesToExtensionTypes] objectForKey:supportedMIMEType];
}
+ (NSString *)getSupportedMIMETypeFromVideoFile:(NSString *)supportedVideoFile {
return [[self supportedVideoExtensionTypesToMIMETypes] objectForKey:[supportedVideoFile pathExtension]];
}
+ (NSString *)getSupportedMIMETypeFromAudioFile:(NSString *)supportedAudioFile {
return [[self supportedAudioExtensionTypesToMIMETypes] objectForKey:[supportedAudioFile pathExtension]];
}
+ (NSString *)getSupportedMIMETypeFromImageFile:(NSString *)supportedImageFile {
return [[self supportedImageExtensionTypesToMIMETypes] objectForKey:[supportedImageFile pathExtension]];
}
+ (NSString *)getSupportedMIMETypeFromAnimatedFile:(NSString *)supportedAnimatedFile {
return [[self supportedAnimatedExtensionTypesToMIMETypes] objectForKey:[supportedAnimatedFile pathExtension]];
}
#pragma mark full attachment utilities
+ (BOOL)isAnimated:(NSString *)contentType {
return [MIMETypeUtil isSupportedAnimatedMIMEType:contentType];
@ -364,18 +348,6 @@ NSString *const OWSMimeTypeUnknownForTests = @"unknown/mimetype";
return [[folder stringByAppendingFormat:@"/%@", uniqueId] stringByAppendingPathExtension:fileExtension];
}
#if TARGET_OS_IPHONE
+ (NSString *)getSupportedImageMIMETypeFromImage:(UIImage *)image {
return [image contentType];
}
+ (BOOL)getIsSupportedTypeFromImage:(UIImage *)image {
return [image isSupportedImageType];
}
#endif
+ (NSString *)utiTypeForMIMEType:(NSString *)mimeType
{
CFStringRef utiType

Loading…
Cancel
Save