diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-08 17:08:36 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-08 17:08:36 +0200 |
commit | 6c85a913c06661aa3f095cdf4bf278d5d65b6930 (patch) | |
tree | ed96474a8f3cf682ecbfb68c5135e23077177dae /examples/imapresource/imapserverproxy.h | |
parent | 16d4e7fcbe4e7817b4cbe4f7d2644520e1af1658 (diff) | |
download | sink-6c85a913c06661aa3f095cdf4bf278d5d65b6930.tar.gz sink-6c85a913c06661aa3f095cdf4bf278d5d65b6930.zip |
Less hardcoded assumptions and a new RID scheme
By using (folder local id:imap uid) for mails, we don't have to change
mail rid's on folder renames.
Diffstat (limited to 'examples/imapresource/imapserverproxy.h')
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index 05409c5..67ff000 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -54,13 +54,29 @@ struct Folder { | |||
54 | return pathParts.join('/'); | 54 | return pathParts.join('/'); |
55 | } | 55 | } |
56 | 56 | ||
57 | QString parentPath() const | ||
58 | { | ||
59 | auto parts = pathParts; | ||
60 | parts.removeLast(); | ||
61 | return parts.join(separator); | ||
62 | } | ||
63 | |||
57 | QList<QString> pathParts; | 64 | QList<QString> pathParts; |
65 | QString path; | ||
66 | QChar separator; | ||
58 | }; | 67 | }; |
59 | 68 | ||
60 | class ImapServerProxy { | 69 | class ImapServerProxy { |
61 | KIMAP::Session *mSession; | 70 | KIMAP::Session *mSession; |
62 | QChar mSeparatorCharacter; | ||
63 | QStringList mCapabilities; | 71 | QStringList mCapabilities; |
72 | |||
73 | QSet<QString> mPersonalNamespaces; | ||
74 | QChar mPersonalNamespaceSeparator; | ||
75 | QSet<QString> mSharedNamespaces; | ||
76 | QChar mSharedNamespaceSeparator; | ||
77 | QSet<QString> mUserNamespaces; | ||
78 | QChar mUserNamespaceSeparator; | ||
79 | |||
64 | public: | 80 | public: |
65 | ImapServerProxy(const QString &serverUrl, int port); | 81 | ImapServerProxy(const QString &serverUrl, int port); |
66 | 82 | ||
@@ -93,6 +109,10 @@ public: | |||
93 | KAsync::Job<QList<qint64>> fetchHeaders(const QString &mailbox); | 109 | KAsync::Job<QList<qint64>> fetchHeaders(const QString &mailbox); |
94 | KAsync::Job<void> remove(const QString &mailbox, const KIMAP::ImapSet &set); | 110 | KAsync::Job<void> remove(const QString &mailbox, const KIMAP::ImapSet &set); |
95 | KAsync::Job<void> remove(const QString &mailbox, const QByteArray &imapSet); | 111 | KAsync::Job<void> remove(const QString &mailbox, const QByteArray &imapSet); |
112 | KAsync::Job<QString> createSubfolder(const QString &parentMailbox, const QString &folderName); | ||
113 | KAsync::Job<QString> renameSubfolder(const QString &mailbox, const QString &newName); | ||
114 | |||
115 | QString mailboxFromFolder(const Folder &) const; | ||
96 | 116 | ||
97 | KAsync::Job<void> fetchFolders(std::function<void(const QVector<Folder> &)> callback); | 117 | KAsync::Job<void> fetchFolders(std::function<void(const QVector<Folder> &)> callback); |
98 | KAsync::Job<void> fetchMessages(const Folder &folder, std::function<void(const QVector<Message> &)> callback); | 118 | KAsync::Job<void> fetchMessages(const Folder &folder, std::function<void(const QVector<Message> &)> callback); |