From 45041904b46a67ec10ad5077ee3b64bb4b574c28 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Jun 2009 13:00:48 +0000 Subject: [PATCH] Do not notify about auto-read messages. For example when setting spam to be marked as read automatically I don't really want to get the notification alert. This has been laying around on my drive for a long time now... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31028 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../mail_daemon/system_filters/notifier/filter.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/add-ons/mail_daemon/system_filters/notifier/filter.cpp b/src/add-ons/mail_daemon/system_filters/notifier/filter.cpp index e5eb542b1e..5363a404ab 100644 --- a/src/add-ons/mail_daemon/system_filters/notifier/filter.cpp +++ b/src/add-ons/mail_daemon/system_filters/notifier/filter.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -63,15 +64,20 @@ status_t NotifyFilter::InitCheck(BString* err) return B_OK; } -status_t NotifyFilter::ProcessMailMessage(BPositionIO**, BEntry*, BMessage*headers, BPath*, const char*) +status_t NotifyFilter::ProcessMailMessage(BPositionIO**, BEntry*, BMessage*headers, BPath*path, const char*) { if (callback == NULL) { callback = new NotifyCallback(strategy,_runner,this); _runner->RegisterProcessCallback(callback); } - if (!headers->FindBool("ENTIRE_MESSAGE")) - callback->num_messages ++; + if (!headers->FindBool("ENTIRE_MESSAGE")) { + BString status; + headers->FindString("STATUS", &status); + // do not notify about auto-read messages + if (status.Compare("Read") != 0) + callback->num_messages ++; + } return B_OK; }