diff options
author | Don Sanders <don.sanders@nokia.com> | 2011-06-06 16:00:58 +0300 |
---|---|---|
committer | Don Sanders <don.sanders@nokia.com> | 2011-06-06 16:00:58 +0300 |
commit | a1b12ac205a8d2365435b086ec4877b77c4acefb (patch) | |
tree | 0d16ec2c7c9d4999e8d19c1b6ebff3ab2e4a6824 | |
parent | 813bd1402bc1b882b6053d6b28f817ce00d693aa (diff) |
Ignore spurious exists notifications in imap idle code.2011W22
Fix for NB#260769
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | src/plugins/messageservices/imap/imapprotocol.cpp | 13 |
2 files changed, 11 insertions, 7 deletions
@@ -6,8 +6,9 @@ Latest Changes * Fixes: NB#249858 Random crash observed with assert * Fixes: NB#207864 Protocol plugin services should only be restarted when necessary * Fixes: NB#217492 "Unable to retrieve message list for unconfigured accounts" is displayed as title in Inbox - * Fixes: NB#261611 - Random messageserver crash observed when disabling IMAP accounts - * Fixes: NB#252787 - Unable to send an invitation if location is selected for the event + * Fixes: NB#261611 Random messageserver crash observed when disabling IMAP accounts + * Fixes: NB#252787 Unable to send an invitation if location is selected for the event + * Fixes: NB#260769 gmail sync triggered every 10 minutes in "Always upto date" mode 201121 * Fixes: NB#232541 Calendar icon not displayed diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp index 628a060c..94aae732 100644 --- a/src/plugins/messageservices/imap/imapprotocol.cpp +++ b/src/plugins/messageservices/imap/imapprotocol.cpp @@ -336,6 +336,7 @@ public: // Update the protocol's mailbox properties void setMailbox(const QMailFolder &mailbox) { mProtocol->_mailbox = ImapMailboxProperties(mailbox); } void setExists(quint32 n) { mProtocol->_mailbox.exists = n; emit mProtocol->exists(n); } + quint32 exists() { return mProtocol->_mailbox.exists; } void setRecent(quint32 n) { mProtocol->_mailbox.recent = n; emit mProtocol->recent(n); } void setUnseen(quint32 n) { mProtocol->_mailbox.unseen = n; } void setUidValidity(const QString &validity) { mProtocol->_mailbox.uidValidity = validity; emit mProtocol->uidValidity(validity); } @@ -2461,12 +2462,12 @@ void EnableState::taggedResponse(ImapContext *c, const QString &line) ImapState::taggedResponse(c, line); } -class NoopState : public ImapState +class NoopState : public SelectedState { Q_OBJECT public: - NoopState() : ImapState(IMAP_Noop, "Noop") {} + NoopState() : SelectedState(IMAP_Noop, "Noop") {} virtual bool permitsPipelining() const { return true; } virtual QString transmit(ImapContext *c); @@ -2487,12 +2488,12 @@ public: }; -class IdleState : public ImapState +class IdleState : public SelectedState { Q_OBJECT public: - IdleState() : ImapState(IMAP_Idle, "Idle") {} + IdleState() : SelectedState(IMAP_Idle, "Idle") {} void done(ImapContext *c); @@ -2521,9 +2522,11 @@ void IdleState::untaggedResponse(ImapContext *c, const QString &line) { QString str = line; QRegExp idleResponsePattern("\\*\\s+\\d+\\s+(\\w+)"); + quint32 previousExists = c->exists(); + SelectedState::untaggedResponse(c, line); if (idleResponsePattern.indexIn(str) == 0) { // Treat this event as a continuation point - if (idleResponsePattern.cap(1).compare("EXISTS", Qt::CaseInsensitive) == 0) { + if (previousExists != c->exists()) { c->continuation(command(), QString("newmail")); } else if (idleResponsePattern.cap(1).compare("FETCH", Qt::CaseInsensitive) == 0) { c->continuation(command(), QString("flagschanged")); |