diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-02 11:54:55 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-02 11:54:55 +0100 |
commit | ee5dfc0878059a48fdff7ca16b0aa69a652414d5 (patch) | |
tree | ac57d2df7aa1344462be2638269875672b7250f0 | |
parent | cd3f995fe28d4b8e61137692672ebd3436f651f0 (diff) | |
download | sink-ee5dfc0878059a48fdff7ca16b0aa69a652414d5.tar.gz sink-ee5dfc0878059a48fdff7ca16b0aa69a652414d5.zip |
Subscribe to mailboxes we create in tests
-rw-r--r-- | examples/imapresource/imapserverproxy.cpp | 8 | ||||
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 1 | ||||
-rw-r--r-- | examples/imapresource/tests/imapmailsynctest.cpp | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp index 08001d9..ce379de 100644 --- a/examples/imapresource/imapserverproxy.cpp +++ b/examples/imapresource/imapserverproxy.cpp | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <KIMAP2/CapabilitiesJob> | 32 | #include <KIMAP2/CapabilitiesJob> |
33 | #include <KIMAP2/SearchJob> | 33 | #include <KIMAP2/SearchJob> |
34 | #include <KIMAP2/GetMetaDataJob> | 34 | #include <KIMAP2/GetMetaDataJob> |
35 | #include <KIMAP2/SubscribeJob> | ||
35 | 36 | ||
36 | #include <KCoreAddons/KJob> | 37 | #include <KCoreAddons/KJob> |
37 | 38 | ||
@@ -321,6 +322,13 @@ KAsync::Job<void> ImapServerProxy::create(const QString &mailbox) | |||
321 | return runJob(create); | 322 | return runJob(create); |
322 | } | 323 | } |
323 | 324 | ||
325 | KAsync::Job<void> ImapServerProxy::subscribe(const QString &mailbox) | ||
326 | { | ||
327 | auto job = new KIMAP2::SubscribeJob(mSession); | ||
328 | job->setMailBox(mailbox); | ||
329 | return runJob(job); | ||
330 | } | ||
331 | |||
324 | KAsync::Job<void> ImapServerProxy::rename(const QString &mailbox, const QString &newMailbox) | 332 | KAsync::Job<void> ImapServerProxy::rename(const QString &mailbox, const QString &newMailbox) |
325 | { | 333 | { |
326 | auto rename = new KIMAP2::RenameJob(mSession); | 334 | auto rename = new KIMAP2::RenameJob(mSession); |
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index 013c18f..cb39b29 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -272,6 +272,7 @@ public: | |||
272 | KAsync::Job<void> create(const QString &mailbox); | 272 | KAsync::Job<void> create(const QString &mailbox); |
273 | KAsync::Job<void> rename(const QString &mailbox, const QString &newMailbox); | 273 | KAsync::Job<void> rename(const QString &mailbox, const QString &newMailbox); |
274 | KAsync::Job<void> remove(const QString &mailbox); | 274 | KAsync::Job<void> remove(const QString &mailbox); |
275 | KAsync::Job<void> subscribe(const QString &mailbox); | ||
275 | KAsync::Job<void> expunge(); | 276 | KAsync::Job<void> expunge(); |
276 | KAsync::Job<void> expunge(const KIMAP2::ImapSet &set); | 277 | KAsync::Job<void> expunge(const KIMAP2::ImapSet &set); |
277 | KAsync::Job<void> copy(const KIMAP2::ImapSet &set, const QString &newMailbox); | 278 | KAsync::Job<void> copy(const KIMAP2::ImapSet &set, const QString &newMailbox); |
diff --git a/examples/imapresource/tests/imapmailsynctest.cpp b/examples/imapresource/tests/imapmailsynctest.cpp index e40aec8..2d937ce 100644 --- a/examples/imapresource/tests/imapmailsynctest.cpp +++ b/examples/imapresource/tests/imapmailsynctest.cpp | |||
@@ -87,6 +87,7 @@ protected: | |||
87 | Imap::ImapServerProxy imap("localhost", 143, Imap::NoEncryption); | 87 | Imap::ImapServerProxy imap("localhost", 143, Imap::NoEncryption); |
88 | VERIFYEXEC(imap.login("doe", "doe")); | 88 | VERIFYEXEC(imap.login("doe", "doe")); |
89 | VERIFYEXEC(imap.create("INBOX." + folderPath.join('.'))); | 89 | VERIFYEXEC(imap.create("INBOX." + folderPath.join('.'))); |
90 | VERIFYEXEC(imap.subscribe("INBOX." + folderPath.join('.'))); | ||
90 | } | 91 | } |
91 | 92 | ||
92 | void removeFolder(const QStringList &folderPath) Q_DECL_OVERRIDE | 93 | void removeFolder(const QStringList &folderPath) Q_DECL_OVERRIDE |