diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-12 02:11:02 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-12 02:11:02 +0200 |
commit | 3fa1766af3fa85067d4b2d48c8410e6c201ae323 (patch) | |
tree | 5662b068088472ad7133d2b91bb0e0ffe1d9b10c /examples/imapresource/imapresource.cpp | |
parent | ce56e7e0c973d31a900c9c467f639a344ea71bf1 (diff) | |
download | sink-3fa1766af3fa85067d4b2d48c8410e6c201ae323.tar.gz sink-3fa1766af3fa85067d4b2d48c8410e6c201ae323.zip |
Moving of mails between folders
Diffstat (limited to 'examples/imapresource/imapresource.cpp')
-rw-r--r-- | examples/imapresource/imapresource.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index aca1c01..8cbb9fa 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -491,8 +491,11 @@ public: | |||
491 | flags << Imap::Flags::Flagged; | 491 | flags << Imap::Flags::Flagged; |
492 | } | 492 | } |
493 | 493 | ||
494 | const bool messageChanged = changedProperties.contains(Sink::ApplicationDomain::Mail::MimeMessage::name); | 494 | const bool messageMoved = changedProperties.contains(ApplicationDomain::Mail::Folder::name); |
495 | if (messageChanged) { | 495 | const bool messageChanged = changedProperties.contains(ApplicationDomain::Mail::MimeMessage::name); |
496 | if (messageChanged || messageMoved) { | ||
497 | const auto folderId = folderIdFromMailRid(oldRemoteId); | ||
498 | const QString oldMailbox = syncStore().resolveLocalId(ENTITY_TYPE_FOLDER, folderId); | ||
496 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); | 499 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); |
497 | QDateTime internalDate = mail.getDate(); | 500 | QDateTime internalDate = mail.getDate(); |
498 | auto rid = QSharedPointer<QByteArray>::create(); | 501 | auto rid = QSharedPointer<QByteArray>::create(); |
@@ -504,7 +507,7 @@ public: | |||
504 | Trace() << "Finished creating a modified mail: " << remoteId; | 507 | Trace() << "Finished creating a modified mail: " << remoteId; |
505 | *rid = remoteId; | 508 | *rid = remoteId; |
506 | }) | 509 | }) |
507 | .then(imap->remove(mailbox, set)) | 510 | .then(imap->remove(oldMailbox, set)) |
508 | .then<QByteArray>([rid, imap]() { | 511 | .then<QByteArray>([rid, imap]() { |
509 | return *rid; | 512 | return *rid; |
510 | }); | 513 | }); |