diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-21 12:06:49 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-21 12:07:39 +0200 |
commit | 8d20128618b427270c6c7db49a1716f65b8ff840 (patch) | |
tree | 1329134c8166040d6719aaa6a5f542dc67f578fc /examples/imapresource/imapserverproxy.h | |
parent | ac73ca1d2a23d3b62cca20545e019355f9d00035 (diff) | |
download | sink-8d20128618b427270c6c7db49a1716f65b8ff840.tar.gz sink-8d20128618b427270c6c7db49a1716f65b8ff840.zip |
Gmail support.
For the time being we hardcode a list of folders that we synchronize
that we know are not duplicating messages.
Diffstat (limited to 'examples/imapresource/imapserverproxy.h')
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index 58c49a2..0d70ba5 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -61,6 +61,7 @@ namespace FolderFlags | |||
61 | extern const char* Junk; | 61 | extern const char* Junk; |
62 | extern const char* Flagged; | 62 | extern const char* Flagged; |
63 | extern const char* All; | 63 | extern const char* All; |
64 | extern const char* Drafts; | ||
64 | } | 65 | } |
65 | 66 | ||
66 | namespace Capabilities | 67 | namespace Capabilities |
@@ -79,6 +80,8 @@ struct Message { | |||
79 | bool fullPayload; | 80 | bool fullPayload; |
80 | }; | 81 | }; |
81 | 82 | ||
83 | bool flagsContain(const QByteArray &f, const QByteArrayList &flags); | ||
84 | |||
82 | struct Folder { | 85 | struct Folder { |
83 | Folder() = default; | 86 | Folder() = default; |
84 | Folder(const QString &path, const QString &ns, const QChar &separator, bool noselect_, bool subscribed_, const QByteArrayList &flags_) | 87 | Folder(const QString &path, const QString &ns, const QChar &separator, bool noselect_, bool subscribed_, const QByteArrayList &flags_) |
@@ -226,11 +229,6 @@ private: | |||
226 | }; | 229 | }; |
227 | 230 | ||
228 | class ImapServerProxy { | 231 | class ImapServerProxy { |
229 | KIMAP2::Session *mSession; | ||
230 | QStringList mCapabilities; | ||
231 | Namespaces mNamespaces; | ||
232 | |||
233 | |||
234 | public: | 232 | public: |
235 | ImapServerProxy(const QString &serverUrl, int port, SessionCache *sessionCache = nullptr); | 233 | ImapServerProxy(const QString &serverUrl, int port, SessionCache *sessionCache = nullptr); |
236 | 234 | ||
@@ -280,9 +278,14 @@ public: | |||
280 | KAsync::Job<QVector<qint64>> fetchUids(const Folder &folder); | 278 | KAsync::Job<QVector<qint64>> fetchUids(const Folder &folder); |
281 | 279 | ||
282 | private: | 280 | private: |
281 | bool isGmail() const; | ||
282 | |||
283 | QString getNamespace(const QString &name); | 283 | QString getNamespace(const QString &name); |
284 | QObject mGuard; | 284 | QObject mGuard; |
285 | SessionCache *mSessionCache; | 285 | SessionCache *mSessionCache; |
286 | KIMAP2::Session *mSession; | ||
287 | QStringList mCapabilities; | ||
288 | Namespaces mNamespaces; | ||
286 | }; | 289 | }; |
287 | 290 | ||
288 | } | 291 | } |