aboutsummaryrefslogtreecommitdiffstats
path: root/src/stringContentHandler.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-06-27 11:56:55 +0000
committerVincent Richard <[email protected]>2013-06-27 11:56:55 +0000
commit86f0a63802d1bb6b2b13b8497a59f7af3a84ed9d (patch)
tree61ac5152b100118e8a5f0fdf63f08d5c35e5b305 /src/stringContentHandler.cpp
parentRemoved debug printf. (diff)
downloadvmime-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.cpp18
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