diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-12 17:30:38 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-12 17:30:38 +0200 |
commit | a2894c03a83d3d9a00d44c752aa94fc12c96d858 (patch) | |
tree | 7dc9056d7c249ac7b78d446ee4aaf68dea9173f8 /framework/src/domain/mime/mailtemplates.cpp | |
parent | c01bd56f6fd78a33669e683f088db36d6c920f39 (diff) | |
download | kube-a2894c03a83d3d9a00d44c752aa94fc12c96d858.tar.gz kube-a2894c03a83d3d9a00d44c752aa94fc12c96d858.zip |
Load html messages as html
Diffstat (limited to 'framework/src/domain/mime/mailtemplates.cpp')
-rw-r--r-- | framework/src/domain/mime/mailtemplates.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/framework/src/domain/mime/mailtemplates.cpp b/framework/src/domain/mime/mailtemplates.cpp index e8d80d40..bbe079d8 100644 --- a/framework/src/domain/mime/mailtemplates.cpp +++ b/framework/src/domain/mime/mailtemplates.cpp | |||
@@ -887,6 +887,19 @@ QString MailTemplates::plaintextContent(const KMime::Message::Ptr &msg) | |||
887 | return plain; | 887 | return plain; |
888 | } | 888 | } |
889 | 889 | ||
890 | QString MailTemplates::body(const KMime::Message::Ptr &msg, bool &isHtml) | ||
891 | { | ||
892 | MimeTreeParser::ObjectTreeParser otp; | ||
893 | otp.parseObjectTree(msg.data()); | ||
894 | const auto html = otp.htmlContent(); | ||
895 | if (html.isEmpty()) { | ||
896 | isHtml = false; | ||
897 | return otp.plainTextContent(); | ||
898 | } | ||
899 | isHtml = true; | ||
900 | return html; | ||
901 | } | ||
902 | |||
890 | static KMime::Content *createAttachmentPart(const QByteArray &content, const QString &filename, bool isInline, const QByteArray &mimeType, const QString &name) | 903 | static KMime::Content *createAttachmentPart(const QByteArray &content, const QString &filename, bool isInline, const QByteArray &mimeType, const QString &name) |
891 | { | 904 | { |
892 | 905 | ||