diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-03-25 20:20:07 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-03-25 20:20:24 +0200 |
commit | f9301c6c042546a86f28f2ddaccadca7bcf8b9a6 (patch) | |
tree | 173ae65f5292e37b3fec32edb26eb22cebc34ed5 /kmail/kmmessage.cpp | |
parent | 3f26d326c9bd8fbd60e5d89e20a705c87a837b1f (diff) | |
download | tdepim-f9301c6c042546a86f28f2ddaccadca7bcf8b9a6.tar.gz tdepim-f9301c6c042546a86f28f2ddaccadca7bcf8b9a6.zip |
kmail: Avoid setting charset on non-textual parts of emails
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 3479159c7ff5c918af12e29a32367843f336b57f)
Diffstat (limited to 'kmail/kmmessage.cpp')
-rw-r--r-- | kmail/kmmessage.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp index c33fdf6a2..d99614785 100644 --- a/kmail/kmmessage.cpp +++ b/kmail/kmmessage.cpp @@ -3055,8 +3055,11 @@ void applyHeadersToMessagePart( DwHeaders& headers, KMMessagePart* aPart ) DwParameter *param = ct.FirstParameter(); while(param) { - if (!tqstricmp(param->Attribute().c_str(), "charset")) - aPart->setCharset(TQCString(param->Value().c_str()).lower()); + if (!tqstricmp(param->Attribute().c_str(), "charset")) { + if (aPart->type() == DwMime::kTypeText) { + aPart->setCharset(TQCString(param->Value().c_str()).lower()); + } + } else if (!tqstrnicmp(param->Attribute().c_str(), "name*", 5)) aPart->setName(KMMsgBase::decodeRFC2231String(KMMsgBase::extractRFC2231HeaderField( param->Value().c_str(), "name" ))); else { |