aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2007-02-06 11:32:29 +0000
committerVincent Richard <[email protected]>2007-02-06 11:32:29 +0000
commit04509027fbe10df0b7d63a2b581bfda60f471d4f (patch)
tree1a7843aa60dd897e2eb07c83e7757e83d5445f89
parentChanged copyright year to 2007. (diff)
downloadvmime-04509027fbe10df0b7d63a2b581bfda60f471d4f.tar.gz
vmime-04509027fbe10df0b7d63a2b581bfda60f471d4f.zip
Root part should not be detected as an attachment.
-rw-r--r--src/attachmentHelper.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp
index 6b281fe9..ad7666f5 100644
--- a/src/attachmentHelper.cpp
+++ b/src/attachmentHelper.cpp
@@ -50,10 +50,14 @@ const bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
return true;
// 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) &&
!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;
}
}