From 73da57481bbc0cd59fb42b62ec969ff58f3a6c86 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Wed, 23 Feb 2011 02:25:22 +0000 Subject: [PATCH] - Don't download messages flaged as deleted. - Set watching variable when leaving the watching method. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40635 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../inbound_protocols/imap/imap_lib/IMAPHandler.cpp | 12 ++++++------ .../inbound_protocols/imap/imap_lib/IMAPMailbox.cpp | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp index f2136e66ab..15e0ab1af8 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp @@ -192,8 +192,6 @@ FetchMinMessageCommand::Command() bool FetchMinMessageCommand::Handle(const BString& response) { - if (response.FindFirst("FETCH") < 0) - return false; BString extracted = response; int32 message; if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message)) @@ -210,6 +208,9 @@ FetchMinMessageCommand::Handle(const BString& response) if (!ParseMinMessage(extracted, minMessage)) return false; + if ((minMessage.flags & kDeleted) != 0) + return true; + fMinMessageList->push_back(minMessage); fStorage.AddNewMessage(minMessage.uid, minMessage.flags, fData); return true; @@ -284,8 +285,6 @@ FetchMessageListCommand::Command() bool FetchMessageListCommand::Handle(const BString& response) { - if (response.FindFirst("FETCH") < 0) - return false; BString extracted = response; int32 message; if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message)) @@ -295,6 +294,9 @@ FetchMessageListCommand::Handle(const BString& response) if (!FetchMinMessageCommand::ParseMinMessage(extracted, minMessage)) return false; + if ((minMessage.flags & kDeleted) != 0) + return true; + fMinMessageList->push_back(minMessage); return true; } @@ -345,8 +347,6 @@ FetchMessageCommand::Command() bool FetchMessageCommand::Handle(const BString& response) { - if (response.FindFirst("FETCH") < 0) - return false; BString extracted = response; int32 message; if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message)) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp index 1856b4384a..7cf236808d 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp @@ -157,6 +157,7 @@ IMAPMailbox::StartWatchingMailbox() if (status != B_OK) break; } + atomic_set(&fWatching, 0); return status; }