Skip to content

Commit

Permalink
Always parse content ID if is part of the MIME fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mronge committed Dec 7, 2012
1 parent 1ce3163 commit 1e5dbbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/CTMIME_SinglePart.m
Expand Up @@ -87,6 +87,10 @@ - (id)initWithMIMEStruct:(struct mailmime *)mime

mMimeFields = mailmime_single_fields_new(mMime->mm_mime_fields, mMime->mm_content_type);
if (mMimeFields != NULL) {
if (mMimeFields->fld_id != NULL) {
self.contentId = [NSString stringWithCString:mMimeFields->fld_id encoding:NSUTF8StringEncoding];
}

struct mailmime_disposition *disp = mMimeFields->fld_disposition;
if (disp != NULL) {
if (disp->dsp_type != NULL) {
Expand All @@ -110,9 +114,6 @@ - (id)initWithMIMEStruct:(struct mailmime *)mime
if (mMimeFields->fld_disposition_filename != NULL) {
self.filename = [NSString stringWithCString:mMimeFields->fld_disposition_filename encoding:NSUTF8StringEncoding];

if (mMimeFields->fld_id != NULL)
self.contentId = [NSString stringWithCString:mMimeFields->fld_id encoding:NSUTF8StringEncoding];

NSString* lowercaseName = [self.filename lowercaseString];
if([lowercaseName hasSuffix:@".xls"] ||
[lowercaseName hasSuffix:@".xlsx"] ||
Expand Down

0 comments on commit 1e5dbbb

Please sign in to comment.