Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 24a02310 authored by Laurent Montel's avatar Laurent Montel 😁

Fix [kmail2] [Bug 390847] New: Saving an encapsulated message doesn't work

FIXED-IN: 18.04.0
BUG: 390847
parent 9d21f32f
......@@ -72,6 +72,7 @@
#include <KEmailAddress>
#include <AkonadiCore/ItemModifyJob>
#include <AkonadiCore/ItemCreateJob>
#include <messageflags.h>
#include <mailtransportakonadi/errorattribute.h>
......@@ -2751,6 +2752,25 @@ void ViewerPrivate::slotHandleAttachment(int choice)
break;
case Viewer::Save:
{
const bool isEncapsulatedMessage = mCurrentContent->parent() && mCurrentContent->parent()->bodyIsMessage();
if (isEncapsulatedMessage) {
KMime::Message::Ptr message = KMime::Message::Ptr(new KMime::Message);
message->setContent(mCurrentContent->parent()->bodyAsMessage()->encodedContent());
message->parse();
Akonadi::Item item;
item.setPayload<KMime::Message::Ptr>(message);
Akonadi::MessageFlags::copyMessageFlags(*message, item);
item.setMimeType(KMime::Message::mimeType());
Util::saveMessageInMbox(Akonadi::Item::List() << item, mMainWindow);
//TODO reimplement openattachementfolder widget!!!!
//showOpenAttachmentFolderWidget(urlList);
return;
}
QList<QUrl> urlList;
if (Util::saveContents(mMainWindow, KMime::Content::List() << mCurrentContent, urlList)) {
showOpenAttachmentFolderWidget(urlList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment