author | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
commit | 6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (side-by-side diff) | |
tree | cb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/libetpan/mbox/mailmbox.c | |
parent | b9257cb225cd29bab5d96fcdaf557926603ee587 (diff) | |
download | kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2 |
Mail fixes and libetpan updated
Diffstat (limited to 'kmicromail/libetpan/mbox/mailmbox.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libetpan/mbox/mailmbox.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/kmicromail/libetpan/mbox/mailmbox.c b/kmicromail/libetpan/mbox/mailmbox.c index 280c313..b3fce02 100644 --- a/kmicromail/libetpan/mbox/mailmbox.c +++ b/kmicromail/libetpan/mbox/mailmbox.c @@ -197,6 +197,9 @@ int mailmbox_open(struct mailmbox_folder * folder) int fd; int read_only; + fd = -1; + read_only = TRUE; + if (!folder->mb_read_only) { read_only = FALSE; fd = open(folder->mb_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); @@ -617,6 +620,8 @@ mailmbox_append_message_list_no_lock(struct mailmbox_folder * folder, folder->mb_max_uid + i + 1, folder->mb_no_uid); extra_size += 2; /* CR LF */ + + info->ai_uid = folder->mb_max_uid + i + 1; } left = folder->mb_mapping_size; @@ -744,8 +749,8 @@ mailmbox_append_message_list(struct mailmbox_folder * folder, } int -mailmbox_append_message(struct mailmbox_folder * folder, - const char * data, size_t len) +mailmbox_append_message_uid(struct mailmbox_folder * folder, + const char * data, size_t len, unsigned int * puid) { carray * tab; struct mailmbox_append_info * append_info; @@ -771,7 +776,10 @@ mailmbox_append_message(struct mailmbox_folder * folder, } r = mailmbox_append_message_list(folder, tab); - + + if (puid != NULL) + * puid = append_info->ai_uid; + mailmbox_append_info_free(append_info); carray_free(tab); @@ -785,6 +793,13 @@ mailmbox_append_message(struct mailmbox_folder * folder, return res; } +int +mailmbox_append_message(struct mailmbox_folder * folder, + const char * data, size_t len) +{ + return mailmbox_append_message_uid(folder, data, len, NULL); +} + /* ********************************************************************** */ int mailmbox_fetch_msg_no_lock(struct mailmbox_folder * folder, |