diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-08-25 09:30:43 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | fe6a1094ff67442e05b409bffedd6b3ca017a2c3 (patch) | |
tree | ed9e24470fd50692b21b73b91ea960c26006a0f1 /examples/imapresource/imapresource.cpp | |
parent | b1b128bb35c91c3a8fe3c36a31ba4676ff0cd54e (diff) | |
download | sink-fe6a1094ff67442e05b409bffedd6b3ca017a2c3.tar.gz sink-fe6a1094ff67442e05b409bffedd6b3ca017a2c3.zip |
Use KIMAP2
Diffstat (limited to 'examples/imapresource/imapresource.cpp')
-rw-r--r-- | examples/imapresource/imapresource.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index f78376a..da87bdb 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -344,7 +344,7 @@ public: | |||
344 | const QString mailbox = syncStore().resolveLocalId(ENTITY_TYPE_FOLDER, folderId); | 344 | const QString mailbox = syncStore().resolveLocalId(ENTITY_TYPE_FOLDER, folderId); |
345 | const auto uid = uidFromMailRid(oldRemoteId); | 345 | const auto uid = uidFromMailRid(oldRemoteId); |
346 | SinkTrace() << "Removing a mail: " << oldRemoteId << "in the mailbox: " << mailbox; | 346 | SinkTrace() << "Removing a mail: " << oldRemoteId << "in the mailbox: " << mailbox; |
347 | KIMAP::ImapSet set; | 347 | KIMAP2::ImapSet set; |
348 | set.add(uid); | 348 | set.add(uid); |
349 | return login.then(imap->remove(mailbox, set)) | 349 | return login.then(imap->remove(mailbox, set)) |
350 | .syncThen<QByteArray>([imap, oldRemoteId] { | 350 | .syncThen<QByteArray>([imap, oldRemoteId] { |
@@ -373,7 +373,7 @@ public: | |||
373 | const QString oldMailbox = syncStore().resolveLocalId(ENTITY_TYPE_FOLDER, folderId); | 373 | const QString oldMailbox = syncStore().resolveLocalId(ENTITY_TYPE_FOLDER, folderId); |
374 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); | 374 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); |
375 | QDateTime internalDate = mail.getDate(); | 375 | QDateTime internalDate = mail.getDate(); |
376 | KIMAP::ImapSet set; | 376 | KIMAP2::ImapSet set; |
377 | set.add(uid); | 377 | set.add(uid); |
378 | return login.then(imap->append(mailbox, content, flags, internalDate)) | 378 | return login.then(imap->append(mailbox, content, flags, internalDate)) |
379 | .addToContext(imap) | 379 | .addToContext(imap) |
@@ -384,7 +384,7 @@ public: | |||
384 | }); | 384 | }); |
385 | } else { | 385 | } else { |
386 | SinkTrace() << "Updating flags only."; | 386 | SinkTrace() << "Updating flags only."; |
387 | KIMAP::ImapSet set; | 387 | KIMAP2::ImapSet set; |
388 | set.add(uid); | 388 | set.add(uid); |
389 | return login.then(imap->select(mailbox)) | 389 | return login.then(imap->select(mailbox)) |
390 | .addToContext(imap) | 390 | .addToContext(imap) |
@@ -548,13 +548,13 @@ KAsync::Job<void> ImapResource::inspect(int inspectionType, const QByteArray &in | |||
548 | const auto uid = uidFromMailRid(mailRemoteId); | 548 | const auto uid = uidFromMailRid(mailRemoteId); |
549 | SinkTrace() << "Mail remote id: " << folderRemoteId << mailRemoteId << mail.identifier() << folder.identifier(); | 549 | SinkTrace() << "Mail remote id: " << folderRemoteId << mailRemoteId << mail.identifier() << folder.identifier(); |
550 | 550 | ||
551 | KIMAP::ImapSet set; | 551 | KIMAP2::ImapSet set; |
552 | set.add(uid); | 552 | set.add(uid); |
553 | if (set.isEmpty()) { | 553 | if (set.isEmpty()) { |
554 | return KAsync::error<void>(1, "Couldn't determine uid of mail."); | 554 | return KAsync::error<void>(1, "Couldn't determine uid of mail."); |
555 | } | 555 | } |
556 | KIMAP::FetchJob::FetchScope scope; | 556 | KIMAP2::FetchJob::FetchScope scope; |
557 | scope.mode = KIMAP::FetchJob::FetchScope::Full; | 557 | scope.mode = KIMAP2::FetchJob::FetchScope::Full; |
558 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); | 558 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); |
559 | auto messageByUid = QSharedPointer<QHash<qint64, Imap::Message>>::create(); | 559 | auto messageByUid = QSharedPointer<QHash<qint64, Imap::Message>>::create(); |
560 | SinkTrace() << "Connecting to:" << mServer << mPort; | 560 | SinkTrace() << "Connecting to:" << mServer << mPort; |
@@ -618,9 +618,9 @@ KAsync::Job<void> ImapResource::inspect(int inspectionType, const QByteArray &in | |||
618 | SinkWarning() << "Error in index: " << error.message << property; | 618 | SinkWarning() << "Error in index: " << error.message << property; |
619 | }); | 619 | }); |
620 | 620 | ||
621 | auto set = KIMAP::ImapSet::fromImapSequenceSet("1:*"); | 621 | auto set = KIMAP2::ImapSet::fromImapSequenceSet("1:*"); |
622 | KIMAP::FetchJob::FetchScope scope; | 622 | KIMAP2::FetchJob::FetchScope scope; |
623 | scope.mode = KIMAP::FetchJob::FetchScope::Headers; | 623 | scope.mode = KIMAP2::FetchJob::FetchScope::Headers; |
624 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); | 624 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); |
625 | auto messageByUid = QSharedPointer<QHash<qint64, Imap::Message>>::create(); | 625 | auto messageByUid = QSharedPointer<QHash<qint64, Imap::Message>>::create(); |
626 | return imap->login(mUser, mPassword) | 626 | return imap->login(mUser, mPassword) |