|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "TSAttachment.h"
|
|
|
|
|
#import "MIMETypeUtil.h"
|
|
|
|
|
|
|
|
|
|
@implementation TSAttachment
|
|
|
|
|
|
|
|
|
@ -34,4 +35,18 @@
|
|
|
|
|
return [f numberFromString:self.uniqueId];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString*)description {
|
|
|
|
|
NSString *attachmentString = NSLocalizedString(@"ATTACHMENT", nil);
|
|
|
|
|
|
|
|
|
|
if ([MIMETypeUtil isImage:self.contentType]) {
|
|
|
|
|
return [NSString stringWithFormat:@"📷 %@", attachmentString];
|
|
|
|
|
} else if ([MIMETypeUtil isVideo:self.contentType]) {
|
|
|
|
|
return [NSString stringWithFormat:@"📽 %@", attachmentString];
|
|
|
|
|
} else if ([MIMETypeUtil isAudio:self.contentType]) {
|
|
|
|
|
return [NSString stringWithFormat:@"📻 %@", attachmentString];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return attachmentString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|