Write status attributes correctly again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40604 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2011-02-21 23:10:19 +00:00
parent 47d780d247
commit 4ee7dfd971
3 changed files with 10 additions and 3 deletions

View File

@ -7,7 +7,7 @@
#include <NodeInfo.h>
#include <OS.h>
#include <E-mail.h>
#include <mail_util.h>
#include "IMAPMailbox.h"
@ -463,6 +463,11 @@ IMAPStorage::_ReadFilesThread()
status_t
IMAPStorage::_WriteFlags(int32 flags, BNode& node)
{
if ((flags & kSeen) != 0)
write_read_attr(node, B_READ);
else
write_read_attr(node, B_UNREAD);
ssize_t writen = node.WriteAttr("MAIL:server_flags", B_INT32_TYPE, 0,
&flags, sizeof(int32));
if (writen != sizeof(int32))

View File

@ -185,6 +185,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, B_UNREAD);
int32 size = MessageSize(toRetrieve);
if (fFetchBodyLimit < 0 || size <= fFetchBodyLimit) {
error = mailIO.Seek(0, SEEK_END);

View File

@ -64,8 +64,6 @@ HaikuMailFormatFilter::HaikuMailFormatFilter(MailProtocol& protocol,
void
HaikuMailFormatFilter::HeaderFetched(const entry_ref& ref, BFile* file)
{
write_read_attr(*file, B_UNREAD);
file->Seek(0, SEEK_SET);
BMessage attributes;