diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-10 15:06:42 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-10 15:06:42 +0100 |
commit | b78506f50f57f2be59e8baa3a02dd00a2c909e4b (patch) | |
tree | eab05d5909da718bb40e8f3abfb24889dab1eb3a /examples | |
parent | d785bd2f3960ba5ac9f72a12ce27e314c99939cb (diff) | |
download | sink-b78506f50f57f2be59e8baa3a02dd00a2c909e4b.tar.gz sink-b78506f50f57f2be59e8baa3a02dd00a2c909e4b.zip |
Correctly resolve the folder
Diffstat (limited to 'examples')
-rw-r--r-- | examples/imapresource/imapresource.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 113352e..c195cfb 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -471,7 +471,8 @@ public: | |||
471 | auto mailRemoteIds = syncStore().resolveLocalIds(ApplicationDomain::getTypeName<ApplicationDomain::Mail>(), query.ids()); | 471 | auto mailRemoteIds = syncStore().resolveLocalIds(ApplicationDomain::getTypeName<ApplicationDomain::Mail>(), query.ids()); |
472 | QByteArray folderRemoteId; | 472 | QByteArray folderRemoteId; |
473 | for (const auto &r : mailRemoteIds) { | 473 | for (const auto &r : mailRemoteIds) { |
474 | const auto f = folderIdFromMailRid(r); | 474 | const auto folderLocalId = folderIdFromMailRid(r); |
475 | auto f = syncStore().resolveLocalId(ApplicationDomain::getTypeName<ApplicationDomain::Folder>(), folderLocalId); | ||
475 | if (folderRemoteId.isEmpty()) { | 476 | if (folderRemoteId.isEmpty()) { |
476 | folderRemoteId = f; | 477 | folderRemoteId = f; |
477 | } else { | 478 | } else { |
@@ -481,7 +482,7 @@ public: | |||
481 | } | 482 | } |
482 | toFetch << uidFromMailRid(r); | 483 | toFetch << uidFromMailRid(r); |
483 | } | 484 | } |
484 | SinkLog() << "Fetching messages: " << toFetch; | 485 | SinkLog() << "Fetching messages: " << toFetch << folderRemoteId; |
485 | bool headersOnly = false; | 486 | bool headersOnly = false; |
486 | return imap->fetchMessages(Folder{folderRemoteId}, toFetch, headersOnly, [=](const Message &m) { | 487 | return imap->fetchMessages(Folder{folderRemoteId}, toFetch, headersOnly, [=](const Message &m) { |
487 | synchronizeMails(folderRemoteId, m); | 488 | synchronizeMails(folderRemoteId, m); |