Don't alter custom status attribute. Part of #7290.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40729 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2011-02-27 19:53:40 +00:00
parent 1b2142ff26
commit 179d0b37ee

View File

@ -94,6 +94,15 @@ write_read_attr(BNode& node, read_flags flag)
return B_ERROR;
#if R5_COMPATIBLE
// manage the status string only if it currently has a "read" status
BString currentStatus;
if (node.ReadAttrString(B_MAIL_ATTR_STATUS, &currentStatus) == B_OK) {
if (currentStatus.ICompare("New") != 0
&& currentStatus.ICompare("Read") != 0
&& currentStatus.ICompare("Seen") != 0)
return B_OK;
}
const char* statusString = (flag == B_READ) ? "Read"
: (flag == B_SEEN) ? "Seen" : "New";
if (node.WriteAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, statusString,