diff options
-rw-r--r-- | examples/imapresource/imapserverproxy.cpp | 18 | ||||
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp index a5a64db..08001d9 100644 --- a/examples/imapresource/imapserverproxy.cpp +++ b/examples/imapresource/imapserverproxy.cpp | |||
@@ -249,6 +249,24 @@ KAsync::Job<SelectResult> ImapServerProxy::select(const Folder &folder) | |||
249 | return select(mailboxFromFolder(folder)); | 249 | return select(mailboxFromFolder(folder)); |
250 | } | 250 | } |
251 | 251 | ||
252 | KAsync::Job<SelectResult> ImapServerProxy::examine(const QString &mailbox) | ||
253 | { | ||
254 | auto select = new KIMAP2::SelectJob(mSession); | ||
255 | select->setOpenReadOnly(true); | ||
256 | select->setMailBox(mailbox); | ||
257 | select->setCondstoreEnabled(mCapabilities.contains(Capabilities::Condstore)); | ||
258 | return runJob<SelectResult>(select, [select](KJob* job) -> SelectResult { | ||
259 | return {select->uidValidity(), select->nextUid(), select->highestModSequence()}; | ||
260 | }).onError([=] (const KAsync::Error &error) { | ||
261 | SinkWarning() << "Examine failed: " << mailbox; | ||
262 | }); | ||
263 | } | ||
264 | |||
265 | KAsync::Job<SelectResult> ImapServerProxy::examine(const Folder &folder) | ||
266 | { | ||
267 | return examine(mailboxFromFolder(folder)); | ||
268 | } | ||
269 | |||
252 | KAsync::Job<qint64> ImapServerProxy::append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags, const QDateTime &internalDate) | 270 | KAsync::Job<qint64> ImapServerProxy::append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags, const QDateTime &internalDate) |
253 | { | 271 | { |
254 | auto append = new KIMAP2::AppendJob(mSession); | 272 | auto append = new KIMAP2::AppendJob(mSession); |
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index c69fe67..013c18f 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -262,6 +262,8 @@ public: | |||
262 | KAsync::Job<void> logout(); | 262 | KAsync::Job<void> logout(); |
263 | KAsync::Job<SelectResult> select(const QString &mailbox); | 263 | KAsync::Job<SelectResult> select(const QString &mailbox); |
264 | KAsync::Job<SelectResult> select(const Folder &mailbox); | 264 | KAsync::Job<SelectResult> select(const Folder &mailbox); |
265 | KAsync::Job<SelectResult> examine(const QString &mailbox); | ||
266 | KAsync::Job<SelectResult> examine(const Folder &mailbox); | ||
265 | KAsync::Job<qint64> append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags = QList<QByteArray>(), const QDateTime &internalDate = QDateTime()); | 267 | KAsync::Job<qint64> append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags = QList<QByteArray>(), const QDateTime &internalDate = QDateTime()); |
266 | KAsync::Job<void> store(const KIMAP2::ImapSet &set, const QList<QByteArray> &flags); | 268 | KAsync::Job<void> store(const KIMAP2::ImapSet &set, const QList<QByteArray> &flags); |
267 | KAsync::Job<void> storeFlags(const KIMAP2::ImapSet &set, const QList<QByteArray> &flags); | 269 | KAsync::Job<void> storeFlags(const KIMAP2::ImapSet &set, const QList<QByteArray> &flags); |