From 86f0a63802d1bb6b2b13b8497a59f7af3a84ed9d Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 27 Jun 2013 13:56:55 +0200 Subject: Do not QP-encode CRLFs when content type is text. --- src/stringContentHandler.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/stringContentHandler.cpp') diff --git a/src/stringContentHandler.cpp b/src/stringContentHandler.cpp index 52bbd230..e4762dce 100644 --- a/src/stringContentHandler.cpp +++ b/src/stringContentHandler.cpp @@ -44,7 +44,8 @@ stringContentHandler::stringContentHandler(const string& buffer, const vmime::en stringContentHandler::stringContentHandler(const stringContentHandler& cts) - : contentHandler(), m_encoding(cts.m_encoding), m_string(cts.m_string) + : contentHandler(), m_contentType(cts.m_contentType), + m_encoding(cts.m_encoding), m_string(cts.m_string) { } @@ -75,6 +76,7 @@ ref stringContentHandler::clone() const stringContentHandler& stringContentHandler::operator=(const stringContentHandler& cts) { + m_contentType = cts.m_contentType; m_encoding = cts.m_encoding; m_string = cts.m_string; @@ -127,6 +129,7 @@ void stringContentHandler::generate(utility::outputStream& os, ref theEncoder = enc.getEncoder(); theEncoder->getProperties()["maxlinelength"] = maxLineLength; + theEncoder->getProperties()["text"] = (m_contentType.getType() == mediaTypes::TEXT); utility::inputStreamStringProxyAdapter in(m_string); @@ -151,6 +154,7 @@ void stringContentHandler::generate(utility::outputStream& os, { ref theEncoder = enc.getEncoder(); theEncoder->getProperties()["maxlinelength"] = maxLineLength; + theEncoder->getProperties()["text"] = (m_contentType.getType() == mediaTypes::TEXT); utility::inputStreamStringProxyAdapter in(m_string); @@ -217,4 +221,16 @@ bool stringContentHandler::isBuffered() const } +void stringContentHandler::setContentTypeHint(const mediaType& type) +{ + m_contentType = type; +} + + +const mediaType stringContentHandler::getContentTypeHint() const +{ + return m_contentType; +} + + } // vmime -- cgit v1.2.3