author | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
commit | 6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (unidiff) | |
tree | cb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/libetpan/mbox | |
parent | b9257cb225cd29bab5d96fcdaf557926603ee587 (diff) | |
download | kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2 |
Mail fixes and libetpan updated
-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 | |||
@@ -197,6 +197,9 @@ int mailmbox_open(struct mailmbox_folder * folder) | |||
197 | int fd; | 197 | int fd; |
198 | int read_only; | 198 | int read_only; |
199 | 199 | ||
200 | fd = -1; | ||
201 | read_only = TRUE; | ||
202 | |||
200 | if (!folder->mb_read_only) { | 203 | if (!folder->mb_read_only) { |
201 | read_only = FALSE; | 204 | read_only = FALSE; |
202 | fd = open(folder->mb_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); | 205 | 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, | |||
617 | folder->mb_max_uid + i + 1, | 620 | folder->mb_max_uid + i + 1, |
618 | folder->mb_no_uid); | 621 | folder->mb_no_uid); |
619 | extra_size += 2; /* CR LF */ | 622 | extra_size += 2; /* CR LF */ |
623 | |||
624 | info->ai_uid = folder->mb_max_uid + i + 1; | ||
620 | } | 625 | } |
621 | 626 | ||
622 | left = folder->mb_mapping_size; | 627 | left = folder->mb_mapping_size; |
@@ -744,8 +749,8 @@ mailmbox_append_message_list(struct mailmbox_folder * folder, | |||
744 | } | 749 | } |
745 | 750 | ||
746 | int | 751 | int |
747 | mailmbox_append_message(struct mailmbox_folder * folder, | 752 | mailmbox_append_message_uid(struct mailmbox_folder * folder, |
748 | const char * data, size_t len) | 753 | const char * data, size_t len, unsigned int * puid) |
749 | { | 754 | { |
750 | carray * tab; | 755 | carray * tab; |
751 | struct mailmbox_append_info * append_info; | 756 | struct mailmbox_append_info * append_info; |
@@ -771,7 +776,10 @@ mailmbox_append_message(struct mailmbox_folder * folder, | |||
771 | } | 776 | } |
772 | 777 | ||
773 | r = mailmbox_append_message_list(folder, tab); | 778 | r = mailmbox_append_message_list(folder, tab); |
774 | 779 | ||
780 | if (puid != NULL) | ||
781 | * puid = append_info->ai_uid; | ||
782 | |||
775 | mailmbox_append_info_free(append_info); | 783 | mailmbox_append_info_free(append_info); |
776 | carray_free(tab); | 784 | carray_free(tab); |
777 | 785 | ||
@@ -785,6 +793,13 @@ mailmbox_append_message(struct mailmbox_folder * folder, | |||
785 | return res; | 793 | return res; |
786 | } | 794 | } |
787 | 795 | ||
796 | int | ||
797 | mailmbox_append_message(struct mailmbox_folder * folder, | ||
798 | const char * data, size_t len) | ||
799 | { | ||
800 | return mailmbox_append_message_uid(folder, data, len, NULL); | ||
801 | } | ||
802 | |||
788 | /* ********************************************************************** */ | 803 | /* ********************************************************************** */ |
789 | 804 | ||
790 | int mailmbox_fetch_msg_no_lock(struct mailmbox_folder * folder, | 805 | int mailmbox_fetch_msg_no_lock(struct mailmbox_folder * folder, |
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 | |||
@@ -51,6 +51,10 @@ int | |||
51 | mailmbox_append_message(struct mailmbox_folder * folder, | 51 | mailmbox_append_message(struct mailmbox_folder * folder, |
52 | const char * data, size_t len); | 52 | const char * data, size_t len); |
53 | 53 | ||
54 | int | ||
55 | mailmbox_append_message_uid(struct mailmbox_folder * folder, | ||
56 | const char * data, size_t len, unsigned int * puid); | ||
57 | |||
54 | int mailmbox_fetch_msg(struct mailmbox_folder * folder, | 58 | int mailmbox_fetch_msg(struct mailmbox_folder * folder, |
55 | uint32_t num, char ** result, | 59 | uint32_t num, char ** result, |
56 | size_t * result_len); | 60 | size_t * result_len); |
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 | |||
@@ -178,7 +178,8 @@ mailmbox_append_info_new(const char * ai_message, size_t ai_size) | |||
178 | 178 | ||
179 | info->ai_message = ai_message; | 179 | info->ai_message = ai_message; |
180 | info->ai_size = ai_size; | 180 | info->ai_size = ai_size; |
181 | 181 | info->ai_uid = 0; | |
182 | |||
182 | return info; | 183 | return info; |
183 | } | 184 | } |
184 | 185 | ||
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 | |||
@@ -128,6 +128,7 @@ void mailmbox_msg_info_free(struct mailmbox_msg_info * info); | |||
128 | struct mailmbox_append_info { | 128 | struct mailmbox_append_info { |
129 | const char * ai_message; | 129 | const char * ai_message; |
130 | size_t ai_size; | 130 | size_t ai_size; |
131 | unsigned int ai_uid; | ||
131 | }; | 132 | }; |
132 | 133 | ||
133 | struct mailmbox_append_info * | 134 | struct mailmbox_append_info * |