- Extend MarkMailAsRead to take a flag not only a bool value. Write an additional MAIL:read attribute.

- Remove some hard coded paths.
- Catch failure of FindMessage correctly. Thanks Axel.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40593 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2011-02-21 07:24:29 +00:00
parent ba11c28b6b
commit 9967dfd924
20 changed files with 90 additions and 37 deletions
@@ -17,6 +17,7 @@
#include <Entry.h>
#include <File.h>
#include <E-mail.h>
#include <MailSettings.h>
@@ -145,7 +146,7 @@ public:
virtual status_t SyncMessages() = 0;
virtual status_t FetchBody(const entry_ref& ref) = 0;
virtual status_t MarkMessageAsRead(const entry_ref& ref,
bool read = true);
read_flags flag = B_READ);
virtual status_t DeleteMessage(const entry_ref& ref) = 0;
virtual status_t AppendMessage(const entry_ref& ref);
};
@@ -196,7 +197,7 @@ public:
void FetchBody(const entry_ref& ref,
BMessage* launch = NULL);
void MarkMessageAsRead(const entry_ref& ref,
bool read = true);
read_flags flag = B_READ);
void DeleteMessage(const entry_ref& ref);
void AppendMessage(const entry_ref& ref);
private:
+10
View File
@@ -28,6 +28,16 @@ struct entry_ref;
#define B_MAIL_ATTR_MIME "MAIL:mime" // string
#define B_MAIL_ATTR_HEADER "MAIL:header_length" // int32
#define B_MAIL_ATTR_CONTENT "MAIL:content_length" // int32
#define B_MAIL_ATTR_READ "MAIL:read" // int32
// read flags
enum read_flags {
B_UNREAD = 0,
B_SEEN = 1,
B_READ = 2
};
// mail flags
+4 -1
View File
@@ -7,6 +7,9 @@
*/
#include <E-mail.h>
const uint32 kMsgCheckAndSend = 'mbth';
const uint32 kMsgCheckMessage = 'mnow';
const uint32 kMsgSendMessages = 'msnd';
@@ -27,7 +30,7 @@ public:
static int32 CountNewMessages(
bool waitForFetchCompletion = false);
static status_t MarkAsRead(int32 account, const entry_ref& ref,
bool read = true);
read_flags flag = B_READ);
static status_t FetchBody(const entry_ref& ref,
BMessage* launchMessage = NULL);
static status_t Quit();
+1 -1
View File
@@ -39,7 +39,7 @@ typedef enum
} b_mail_status_window_look;
#define kDefaultSentDirectory "/boot/home/mail/sent"
BString default_sent_directory();
class BMailSettings {
+9
View File
@@ -8,8 +8,17 @@
#include <stdio.h>
#include <Node.h>
#include <E-mail.h>
class BString;
status_t write_read_attr(BNode& node, read_flags flag);
// The next couple of functions are our wrapper around convert_to_utf8 and
// convert_from_utf8 so that they can also convert from UTF-8 to UTF-8 by
// specifying the MDR_UTF8_CONVERSION constant as the conversion operation.