summaryrefslogtreecommitdiffstats
path: root/examples/imapresource/imapserverproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imapresource/imapserverproxy.cpp')
-rw-r--r--examples/imapresource/imapserverproxy.cpp18
1 files changed, 18 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
252KAsync::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
265KAsync::Job<SelectResult> ImapServerProxy::examine(const Folder &folder)
266{
267 return examine(mailboxFromFolder(folder));
268}
269
252KAsync::Job<qint64> ImapServerProxy::append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags, const QDateTime &internalDate) 270KAsync::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);