diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/imapresource/imapresource.cpp | 12 | ||||
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 02713b3..b8129cd 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -328,7 +328,7 @@ public: | |||
328 | 328 | ||
329 | } | 329 | } |
330 | 330 | ||
331 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId) | 331 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
332 | { | 332 | { |
333 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); | 333 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); |
334 | auto login = imap->login(mUser, mPassword); | 334 | auto login = imap->login(mUser, mPassword); |
@@ -372,10 +372,8 @@ public: | |||
372 | auto uid = ridParts.takeLast().toLongLong(); | 372 | auto uid = ridParts.takeLast().toLongLong(); |
373 | //FIXME don't hardcode the separator | 373 | //FIXME don't hardcode the separator |
374 | auto mailbox = ridParts.join('.'); | 374 | auto mailbox = ridParts.join('.'); |
375 | Trace() << "Modifying a mail: " << oldRemoteId << " in the mailbox: " << mailbox; | 375 | Trace() << "Modifying a mail: " << oldRemoteId << " in the mailbox: " << mailbox << changedProperties; |
376 | //TODO if the message changed, remove old message and create a new one, | 376 | |
377 | //otherwise only change flags | ||
378 | |||
379 | QByteArrayList flags; | 377 | QByteArrayList flags; |
380 | if (!mail.getUnread()) { | 378 | if (!mail.getUnread()) { |
381 | flags << Imap::Flags::Seen; | 379 | flags << Imap::Flags::Seen; |
@@ -384,7 +382,7 @@ public: | |||
384 | flags << Imap::Flags::Flagged; | 382 | flags << Imap::Flags::Flagged; |
385 | } | 383 | } |
386 | 384 | ||
387 | bool messageChanged = false; | 385 | const bool messageChanged = changedProperties.contains(Sink::ApplicationDomain::Mail::MimeMessage::name); |
388 | if (messageChanged) { | 386 | if (messageChanged) { |
389 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); | 387 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); |
390 | QDateTime internalDate = mail.getDate(); | 388 | QDateTime internalDate = mail.getDate(); |
@@ -431,7 +429,7 @@ public: | |||
431 | return separator + folder.getName(); | 429 | return separator + folder.getName(); |
432 | } | 430 | } |
433 | 431 | ||
434 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId) | 432 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
435 | { | 433 | { |
436 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); | 434 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); |
437 | auto login = imap->login(mUser, mPassword); | 435 | auto login = imap->login(mUser, mPassword); |
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index d67eb50..18f8334 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp | |||
@@ -405,7 +405,7 @@ public: | |||
405 | 405 | ||
406 | } | 406 | } |
407 | 407 | ||
408 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId) | 408 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
409 | { | 409 | { |
410 | if (operation == Sink::Operation_Creation) { | 410 | if (operation == Sink::Operation_Creation) { |
411 | const auto remoteId = getFilePathFromMimeMessagePath(mail.getMimeMessagePath()); | 411 | const auto remoteId = getFilePathFromMimeMessagePath(mail.getMimeMessagePath()); |
@@ -426,7 +426,7 @@ public: | |||
426 | return KAsync::null<QByteArray>(); | 426 | return KAsync::null<QByteArray>(); |
427 | } | 427 | } |
428 | 428 | ||
429 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId) | 429 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
430 | { | 430 | { |
431 | if (operation == Sink::Operation_Creation) { | 431 | if (operation == Sink::Operation_Creation) { |
432 | auto folderName = folder.getName(); | 432 | auto folderName = folder.getName(); |