From 6d9f904958e6c49c2e5a5d9d0255dc64a48ba624 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Wed, 23 Mar 2011 02:02:20 +0000 Subject: [PATCH] Take leave mail on server into account. Should fix #7400. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41091 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../mail_daemon/inbound_protocols/pop3/pop3.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp index 7a7684eec4..ce8270a0fa 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp @@ -155,13 +155,11 @@ POP3Protocol::SyncMessages() return error; } - int32 num_messages; - BStringList toDownload; fManifest.NotHere(fUniqueIDs, &toDownload); - num_messages = toDownload.CountItems(); - if (num_messages == 0) { + int32 numMessages = toDownload.CountItems(); + if (numMessages == 0) { CheckForDeletedMessages(); ResetProgress(); return B_OK; @@ -234,6 +232,12 @@ POP3Protocol::SyncMessages() // save manifest in case we get disturbed fManifest += uid; _WriteManifest(); + + bool leaveOnServer; + if (fSettings.FindBool("leave_mail_on_server", &leaveOnServer) == B_OK + && !leaveOnServer) { + Delete(toRetrieve); + } } ResetProgress(); @@ -814,6 +818,9 @@ POP3Protocol::Delete(int32 num) #if DEBUG puts(fLog.String()); #endif + /* The mail is just marked as deleted and removed from the server when + sending the QUIT command. Because of that the message number stays the same + and we keep the uid in the uid list. */ }