aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-02-26 05:26:24 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-02-26 05:26:24 +0800
commit822bc5f1d92f2f0c481d84c2d40f6f1cf02a5e50 (patch)
tree84b7a6795d7cb46f7e91da41b6931d7a4db61824
parent7330d192f06105417dfaecacf1656033e19f63b8 (diff)
downloadgsoc2013-evolution-822bc5f1d92f2f0c481d84c2d40f6f1cf02a5e50.tar.gz
gsoc2013-evolution-822bc5f1d92f2f0c481d84c2d40f6f1cf02a5e50.tar.zst
gsoc2013-evolution-822bc5f1d92f2f0c481d84c2d40f6f1cf02a5e50.zip
Allow all multiparts that contain message/rfc822 attachments.
2002-02-25 Jeffrey Stedfast <fejj@ximian.com> * camel-digest-folder.c (camel_digest_folder_new): Allow all multiparts that contain message/rfc822 attachments. (digest_get_uids): Only assign uids to message parts. svn path=/trunk/; revision=15836
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-digest-folder.c21
2 files changed, 21 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 3e225e7ce3..f996021409 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-25 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-digest-folder.c (camel_digest_folder_new): Allow all
+ multiparts that contain message/rfc822 attachments.
+ (digest_get_uids): Only assign uids to message parts.
+
2002-02-22 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-part.c (camel_mime_part_set_filename): Set the 'name'
diff --git a/camel/camel-digest-folder.c b/camel/camel-digest-folder.c
index f6cf3e8a93..cdc278c9fa 100644
--- a/camel/camel-digest-folder.c
+++ b/camel/camel-digest-folder.c
@@ -157,17 +157,21 @@ camel_digest_folder_new (CamelMimeMessage *message)
if (!wrapper || !CAMEL_IS_MULTIPART (wrapper))
return NULL;
- if (!header_content_type_is (CAMEL_MIME_PART (message)->content_type, "multipart", "digest")) {
+ if (!header_content_type_is (CAMEL_MIME_PART (message)->content_type, "multipart", "*")) {
+ gboolean is_digest = FALSE;
int i, parts;
/* Make sure we have a multipart of message/rfc822 attachments... */
parts = camel_multipart_get_number (CAMEL_MULTIPART (wrapper));
- for (i = 0; i < parts; i++) {
+ for (i = 0; i < parts && !is_digest; i++) {
CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), i);
- if (!header_content_type_is (part->content_type, "message", "rfc822"))
- return NULL;
+ if (header_content_type_is (part->content_type, "message", "rfc822"))
+ is_digest = TRUE;
}
+
+ if (!is_digest)
+ return NULL;
}
folder = CAMEL_FOLDER (camel_object_new (camel_digest_folder_get_type ()));
@@ -224,12 +228,16 @@ digest_get_uids (CamelFolder *folder)
CamelMimePart *part;
char *uid;
- uid = g_strdup_printf ("%d", i + 1);
-
part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), i);
+
+ if (!header_content_type_is (part->content_type, "message", "rfc822"))
+ continue;
+
message = CAMEL_MIME_MESSAGE (part);
info = camel_message_info_new_from_header (CAMEL_MIME_PART (message)->headers);
+
+ uid = g_strdup_printf ("%d", i + 1);
camel_message_info_set_uid (info, uid);
g_ptr_array_add (uids, uid);
@@ -294,6 +302,7 @@ digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
int id;
id = atoi (uid) - 1;
+ g_assert (id > 0);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (digest->priv->message));
part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), id);