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
This commit is contained in:
Clemens Zeidler 2011-03-23 02:02:20 +00:00
parent 2d5868f8b3
commit 6d9f904958
1 changed files with 11 additions and 4 deletions

View File

@ -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. */
}