diff options
author | Vincent Richard <[email protected]> | 2013-06-27 11:56:55 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-06-27 11:56:55 +0000 |
commit | 86f0a63802d1bb6b2b13b8497a59f7af3a84ed9d (patch) | |
tree | 61ac5152b100118e8a5f0fdf63f08d5c35e5b305 /src/stringContentHandler.cpp | |
parent | Removed debug printf. (diff) | |
download | vmime-86f0a63802d1bb6b2b13b8497a59f7af3a84ed9d.tar.gz vmime-86f0a63802d1bb6b2b13b8497a59f7af3a84ed9d.zip |
Do not QP-encode CRLFs when content type is text.
Diffstat (limited to 'src/stringContentHandler.cpp')
-rw-r--r-- | src/stringContentHandler.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
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 <contentHandler> 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 <utility::encoder::encoder> 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 <utility::encoder::encoder> 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 |