Ticket #7748: MarkAsRead.diff

File MarkAsRead.diff, 1.2 KB (added by humdinger, 13 years ago)

patch to also set MAIL:read to B_READ

  • HiQ-Data/source/haiku/trunk/src/add-ons/tracker/mark_as/MarkAsRead.cpp

     
    55 */
    66
    77
     8#include <E-mail.h>
    89#include <Entry.h>
    910#include <Message.h>
    1011#include <Node.h>
     
    2627            BString status("Read");
    2728
    2829            // Only update the attribute if there is an actual change
    29             if (node.ReadAttrString("MAIL:status", &previousStatus) != B_OK
     30            if (node.ReadAttrString(B_MAIL_ATTR_STATUS, &previousStatus) != B_OK
    3031                || previousStatus != status)
    31                 node.WriteAttrString("MAIL:status", &status);
     32                node.WriteAttrString(B_MAIL_ATTR_STATUS, &status);
     33           
     34            int32 previousReadStatus;
     35            int32 readstatus(B_READ);
     36
     37            // Only update the attribute if there is an actual change
     38            if (node.ReadAttr(B_MAIL_ATTR_READ, B_INT32_TYPE, 0,
     39                &previousReadStatus, sizeof(int32))
     40                != B_OK || previousReadStatus != readstatus)
     41                node.WriteAttr(B_MAIL_ATTR_READ, B_INT32_TYPE, 0,
     42                     &readstatus, sizeof(int32));
    3243        }
    3344    }
    3445}