Do not treat attached text files as text parts.
This commit is contained in:
parent
ea38aa36b3
commit
bcaff413ca
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "vmime/relay.hpp"
|
#include "vmime/relay.hpp"
|
||||||
#include "vmime/contentTypeField.hpp"
|
#include "vmime/contentTypeField.hpp"
|
||||||
|
#include "vmime/contentDispositionField.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime
|
||||||
@ -174,9 +175,23 @@ bool messageParser::findSubTextParts(ref <const bodyPart> msg, ref <const bodyPa
|
|||||||
(*(p->getHeader()->findField(fields::CONTENT_TYPE)));
|
(*(p->getHeader()->findField(fields::CONTENT_TYPE)));
|
||||||
|
|
||||||
const mediaType type = *ctf.getValue().dynamicCast <const mediaType>();
|
const mediaType type = *ctf.getValue().dynamicCast <const mediaType>();
|
||||||
|
contentDisposition disp; // default should be inline
|
||||||
|
|
||||||
if (type.getType() == mediaTypes::TEXT)
|
if (type.getType() == mediaTypes::TEXT)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ref <const contentDispositionField> cdf = p->getHeader()->
|
||||||
|
findField(fields::CONTENT_DISPOSITION).dynamicCast <const contentDispositionField>();
|
||||||
|
|
||||||
|
disp = *cdf->getValue().dynamicCast <const contentDisposition>();
|
||||||
|
}
|
||||||
|
catch (exceptions::no_such_field&)
|
||||||
|
{
|
||||||
|
// No "Content-Disposition" field, assume default
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disp.getName() == contentDispositionTypes::INLINE)
|
||||||
textParts.push_back(p);
|
textParts.push_back(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user