From 55db88b7f49d5b575cfb9fae20e29d6a69a4acc0 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Sun, 13 Feb 2011 23:15:14 +0000 Subject: [PATCH] Fix POP3 mail status #7216. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40482 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 c2293652f2..85191d6c19 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp @@ -184,6 +184,10 @@ POP3Protocol::SyncMessages() entry_ref ref; entry.GetRef(&ref); + // the ref becomes invalid after renaming the file thus we already + // write the status here + MarkMessageAsRead(ref, false); + int32 size = MessageSize(toRetrieve); if (fFetchBodyLimit < 0 || size <= fFetchBodyLimit) { error = mailIO.Seek(0, SEEK_END); @@ -206,8 +210,6 @@ POP3Protocol::SyncMessages() file.WriteAttr("MAIL:size", B_INT32_TYPE, 0, &size, sizeof(int32)); - MarkMessageAsRead(ref, false); - // save manifest in case we get disturbed fManifest += uid; _WriteManifest();