Root part should not be detected as an attachment.

This commit is contained in:
Vincent Richard 2007-02-06 11:32:29 +00:00
parent d284cfa729
commit 04509027fb

View File

@ -50,10 +50,14 @@ const bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
return true; return true;
// If the Content-Disposition is 'inline' and there is no // If the Content-Disposition is 'inline' and there is no
// Content-Id or Content-Location field, it is an attachment // Content-Id or Content-Location field, it may be an attachment
if (!part->getHeader()->hasField(vmime::fields::CONTENT_ID) && if (!part->getHeader()->hasField(vmime::fields::CONTENT_ID) &&
!part->getHeader()->hasField(vmime::fields::CONTENT_LOCATION)) !part->getHeader()->hasField(vmime::fields::CONTENT_LOCATION))
{ {
// If this is the root part, it might not be an attachment
if (part->getParentPart() == NULL)
return false;
return true; return true;
} }
} }