diff options
author | Vincent Richard <[email protected]> | 2014-01-09 23:49:12 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2014-01-09 23:49:12 +0000 |
commit | 426ea685ae35c70a7a5343a9bab28c573d94492e (patch) | |
tree | d96387aeeaaa779e96ede7b0e535b6dc31f26b99 | |
parent | Fixed compiler error on VS (newer versions of OpenSSL return a const pointer). (diff) | |
download | vmime-426ea685ae35c70a7a5343a9bab28c573d94492e.tar.gz vmime-426ea685ae35c70a7a5343a9bab28c573d94492e.zip |
Generate lowercase "cid:" for Apple Mail. Case-insensitive comparison for "cid:" prefix.
-rw-r--r-- | src/vmime/htmlTextPart.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vmime/htmlTextPart.cpp b/src/vmime/htmlTextPart.cpp index 44459336..cd7d6204 100644 --- a/src/vmime/htmlTextPart.cpp +++ b/src/vmime/htmlTextPart.cpp @@ -108,8 +108,14 @@ void htmlTextPart::generateIn(shared_ptr <bodyPart> /* message */, shared_ptr <b string id = (*it)->getId(); - if (id.substr(0, 4) == "CID:") + if (id.length() >= 4 && + (id[0] == 'c' || id[0] == 'C') && + (id[1] == 'i' || id[1] == 'I') && + (id[2] == 'd' || id[2] == 'D') && + id[3] == ':') + { id = id.substr(4); + } objPart->getHeader()->ContentType()->setValue((*it)->getType()); objPart->getHeader()->ContentId()->setValue(messageId("<" + id + ">")); @@ -462,7 +468,7 @@ const string htmlTextPart::embeddedObject::getId() const const string htmlTextPart::embeddedObject::getReferenceId() const { if (m_refType == REFERENCED_BY_ID) - return string("CID:") + m_id; + return string("cid:") + m_id; else return m_id; } |