-rw-r--r-- | kmicromail/libetpan/mbox/mailmbox.c | 21 | ||||
-rw-r--r-- | kmicromail/libetpan/mbox/mailmbox.h | 4 | ||||
-rw-r--r-- | kmicromail/libetpan/mbox/mailmbox_types.c | 3 | ||||
-rw-r--r-- | kmicromail/libetpan/mbox/mailmbox_types.h | 1 |
4 files changed, 25 insertions, 4 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 @@ -199,2 +199,5 @@ int mailmbox_open(struct mailmbox_folder * folder) + fd = -1; + read_only = TRUE; + if (!folder->mb_read_only) { @@ -619,2 +622,4 @@ mailmbox_append_message_list_no_lock(struct mailmbox_folder * folder, extra_size += 2; /* CR LF */ + + info->ai_uid = folder->mb_max_uid + i + 1; } @@ -746,4 +751,4 @@ 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) { @@ -773,3 +778,6 @@ 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); @@ -787,2 +795,9 @@ mailmbox_append_message(struct mailmbox_folder * folder, +int +mailmbox_append_message(struct mailmbox_folder * folder, + const char * data, size_t len) +{ + return mailmbox_append_message_uid(folder, data, len, NULL); +} + /* ********************************************************************** */ diff --git a/kmicromail/libetpan/mbox/mailmbox.h b/kmicromail/libetpan/mbox/mailmbox.h index 8be086c..0427f1f 100644 --- a/kmicromail/libetpan/mbox/mailmbox.h +++ b/kmicromail/libetpan/mbox/mailmbox.h @@ -53,2 +53,6 @@ mailmbox_append_message(struct mailmbox_folder * folder, +int +mailmbox_append_message_uid(struct mailmbox_folder * folder, + const char * data, size_t len, unsigned int * puid); + int mailmbox_fetch_msg(struct mailmbox_folder * folder, diff --git a/kmicromail/libetpan/mbox/mailmbox_types.c b/kmicromail/libetpan/mbox/mailmbox_types.c index 1986182..4e3e521 100644 --- a/kmicromail/libetpan/mbox/mailmbox_types.c +++ b/kmicromail/libetpan/mbox/mailmbox_types.c @@ -180,3 +180,4 @@ mailmbox_append_info_new(const char * ai_message, size_t ai_size) info->ai_size = ai_size; - + info->ai_uid = 0; + return info; diff --git a/kmicromail/libetpan/mbox/mailmbox_types.h b/kmicromail/libetpan/mbox/mailmbox_types.h index dd6758c..bd6ee30 100644 --- a/kmicromail/libetpan/mbox/mailmbox_types.h +++ b/kmicromail/libetpan/mbox/mailmbox_types.h @@ -130,2 +130,3 @@ struct mailmbox_append_info { size_t ai_size; + unsigned int ai_uid; }; |