summaryrefslogtreecommitdiffstats
path: root/framework/src
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-23 22:01:22 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-23 22:01:22 +0200
commit9782eba7c164eba5625bc4224ad0f49ec2fc76a7 (patch)
tree7efdd723b919bd0644f9aa0080c90bffd5dc8447 /framework/src
parent5cb860c194ae08d560156c35309a0a14794a4bda (diff)
downloadkube-9782eba7c164eba5625bc4224ad0f49ec2fc76a7.tar.gz
kube-9782eba7c164eba5625bc4224ad0f49ec2fc76a7.zip
Removed unused code
Diffstat (limited to 'framework/src')
-rw-r--r--framework/src/domain/mime/mailtemplates.cpp62
1 files changed, 12 insertions, 50 deletions
diff --git a/framework/src/domain/mime/mailtemplates.cpp b/framework/src/domain/mime/mailtemplates.cpp
index c7ae481e..2c9f6523 100644
--- a/framework/src/domain/mime/mailtemplates.cpp
+++ b/framework/src/domain/mime/mailtemplates.cpp
@@ -248,54 +248,6 @@ KMime::Content *createMultipartMixedContent(QVector<KMime::Content *> contents)
248 return multiPartMixed; 248 return multiPartMixed;
249} 249}
250 250
251void addProcessedBodyToMessage(const KMime::Message::Ptr &msg, const QString &plainBody, const QString &htmlBody, bool forward)
252{
253 //FIXME
254 // MessageCore::ImageCollector ic;
255 // ic.collectImagesFrom(mOrigMsg.data());
256
257 // Now, delete the old content and set the new content, which
258 // is either only the new text or the new text with some attachments.
259 auto parts = msg->contents();
260 foreach (KMime::Content *content, parts) {
261 msg->removeContent(content, true/*delete*/);
262 }
263
264 msg->contentType()->clear(); // to get rid of old boundary
265
266 const QByteArray boundary = KMime::multiPartBoundary();
267 KMime::Content *const mainTextPart =
268 htmlBody.isEmpty() ?
269 createPlainPartContent(plainBody, msg.data()) :
270 createMultipartAlternativeContent(plainBody, htmlBody, msg.data());
271 mainTextPart->assemble();
272
273 KMime::Content *textPart = mainTextPart;
274 // if (!ic.images().empty()) {
275 // textPart = createMultipartRelated(ic, mainTextPart);
276 // textPart->assemble();
277 // }
278
279 // If we have some attachments, create a multipart/mixed mail and
280 // add the normal body as well as the attachments
281 KMime::Content *mainPart = textPart;
282 //FIXME
283 // if (forward) {
284 // auto attachments = mOrigMsg->attachments();
285 // attachments += mOtp->nodeHelper()->attachmentsOfExtraContents();
286 // if (!attachments.isEmpty()) {
287 // mainPart = createMultipartMixed(attachments, textPart);
288 // mainPart->assemble();
289 // }
290 // }
291
292 msg->setBody(mainPart->encodedBody());
293 msg->setHeader(mainPart->contentType());
294 msg->setHeader(mainPart->contentTransferEncoding());
295 msg->assemble();
296 msg->parse();
297}
298
299QString plainToHtml(const QString &body) 251QString plainToHtml(const QString &body)
300{ 252{
301 QString str = body; 253 QString str = body;
@@ -879,11 +831,21 @@ void MailTemplates::reply(const KMime::Message::Ptr &origMsg, const std::functio
879 }(); 831 }();
880 832
881 //Assemble the message 833 //Assemble the message
882 addProcessedBodyToMessage(msg, plainBodyResult, htmlBodyResult, false); 834 msg->contentType()->clear(); // to get rid of old boundary
835
836 KMime::Content *const mainTextPart =
837 htmlBodyResult.isEmpty() ?
838 createPlainPartContent(plainBodyResult, msg.data()) :
839 createMultipartAlternativeContent(plainBodyResult, htmlBodyResult, msg.data());
840 mainTextPart->assemble();
841
842 msg->setBody(mainTextPart->encodedBody());
843 msg->setHeader(mainTextPart->contentType());
844 msg->setHeader(mainTextPart->contentTransferEncoding());
883 //FIXME this does more harm than good right now. 845 //FIXME this does more harm than good right now.
884 // applyCharset(msg, origMsg); 846 // applyCharset(msg, origMsg);
885 msg->assemble(); 847 msg->assemble();
886 //We're done 848
887 callback(msg); 849 callback(msg);
888 }); 850 });
889 }); 851 });