Browse files

Merge branch 'experimental-1'

  • Loading branch information...
2 parents 34751e2 + e58612d commit 66618c90efbfd20f9719c43a8ea77d88dd160800 @mronge mronge committed Oct 11, 2013
Showing with 27 additions and 26 deletions.
  1. +27 −26 Source/CTMIME_SinglePart.m
View
53 Source/CTMIME_SinglePart.m
@@ -94,8 +94,8 @@ - (id)initWithMIMEStruct:(struct mailmime *)mime
struct mailmime_disposition *disp = mMimeFields->fld_disposition;
if (disp != NULL) {
if (disp->dsp_type != NULL) {
- self.attached = (disp->dsp_type->dsp_type ==
- MAILMIME_DISPOSITION_TYPE_ATTACHMENT);
+ self.attached = (disp->dsp_type->dsp_type == MAILMIME_DISPOSITION_TYPE_ATTACHMENT ||
+ disp->dsp_type->dsp_type == MAILMIME_DISPOSITION_TYPE_INLINE);
if (self.attached)
{
@@ -113,32 +113,33 @@ - (id)initWithMIMEStruct:(struct mailmime *)mime
if (mMimeFields->fld_disposition_filename != NULL) {
self.filename = [NSString stringWithCString:mMimeFields->fld_disposition_filename encoding:NSUTF8StringEncoding];
-
- NSString* lowercaseName = [self.filename lowercaseString];
- if([lowercaseName hasSuffix:@".xls"] ||
- [lowercaseName hasSuffix:@".xlsx"] ||
- [lowercaseName hasSuffix:@".key.zip"] ||
- [lowercaseName hasSuffix:@".numbers.zip"] ||
- [lowercaseName hasSuffix:@".pages.zip"] ||
- [lowercaseName hasSuffix:@".pdf"] ||
- [lowercaseName hasSuffix:@".ppt"] ||
- [lowercaseName hasSuffix:@".doc"] ||
- [lowercaseName hasSuffix:@".docx"] ||
- [lowercaseName hasSuffix:@".rtf"] ||
- [lowercaseName hasSuffix:@".rtfd.zip"] ||
- [lowercaseName hasSuffix:@".key"] ||
- [lowercaseName hasSuffix:@".numbers"] ||
- [lowercaseName hasSuffix:@".pages"] ||
- [lowercaseName hasSuffix:@".png"] ||
- [lowercaseName hasSuffix:@".gif"] ||
- [lowercaseName hasSuffix:@".png"] ||
- [lowercaseName hasSuffix:@".jpg"] ||
- [lowercaseName hasSuffix:@".jpeg"] ||
- [lowercaseName hasSuffix:@".tiff"]) { // hack by gabor, improved by waseem, based on http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
- self.attached = YES;
- }
+ } else if (mMimeFields->fld_location != NULL) {
+ self.filename = [NSString stringWithCString:mMimeFields->fld_location encoding:NSUTF8StringEncoding];
}
+ NSString* lowercaseName = [self.filename lowercaseString];
+ if([lowercaseName hasSuffix:@".xls"] ||
+ [lowercaseName hasSuffix:@".xlsx"] ||
+ [lowercaseName hasSuffix:@".key.zip"] ||
+ [lowercaseName hasSuffix:@".numbers.zip"] ||
+ [lowercaseName hasSuffix:@".pages.zip"] ||
+ [lowercaseName hasSuffix:@".pdf"] ||
+ [lowercaseName hasSuffix:@".ppt"] ||
+ [lowercaseName hasSuffix:@".doc"] ||
+ [lowercaseName hasSuffix:@".docx"] ||
+ [lowercaseName hasSuffix:@".rtf"] ||
+ [lowercaseName hasSuffix:@".rtfd.zip"] ||
+ [lowercaseName hasSuffix:@".key"] ||
+ [lowercaseName hasSuffix:@".numbers"] ||
+ [lowercaseName hasSuffix:@".pages"] ||
+ [lowercaseName hasSuffix:@".png"] ||
+ [lowercaseName hasSuffix:@".gif"] ||
+ [lowercaseName hasSuffix:@".png"] ||
+ [lowercaseName hasSuffix:@".jpg"] ||
+ [lowercaseName hasSuffix:@".jpeg"] ||
+ [lowercaseName hasSuffix:@".tiff"]) { // hack by gabor, improved by waseem, based on http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
+ self.attached = YES;
+ }
}
}
return self;

0 comments on commit 66618c9

Please sign in to comment.