[balsa] Message part is also a part
- From: Peter Bloomfield <PeterB src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [balsa] Message part is also a part
- Date: Sat, 26 Sep 2009 12:51:26 +0000 (UTC)
commit 8654baada203045a03f4a591599ad4c5489a8c8f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sat Sep 26 08:51:20 2009 -0400
Message part is also a part
ChangeLog | 5 ++++
libbalsa/mailbox_mbox.c | 61 ++++++++++++++++++++++------------------------
2 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 35dfe2e..40d8002 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-26 Peter Bloomfield
+
+ * libbalsa/mailbox_mbox.c (lbm_mbox_prepare_object): count
+ GMimeMessagePart as well as GMimePart when skipping parts.
+
2009-09-25 Peter Bloomfield
* libbalsa/mailbox_mbox.c (lbm_mbox_prepare_object),
diff --git a/libbalsa/mailbox_mbox.c b/libbalsa/mailbox_mbox.c
index 599ca28..502b5c8 100644
--- a/libbalsa/mailbox_mbox.c
+++ b/libbalsa/mailbox_mbox.c
@@ -1854,8 +1854,13 @@ lbm_mbox_prepare_object(GMimeObject * parent, GMimeObject * mime_part,
g_mime_object_remove_header(mime_part, "Content-Length");
- if (GMIME_IS_MULTIPART(mime_part)) {
- if (*skip_count || GMIME_IS_MULTIPART_SIGNED(mime_part)
+ if (GMIME_IS_MESSAGE(mime_part))
+ lbm_mbox_prepare_object(NULL,
+ ((GMimeMessage *) mime_part)->mime_part,
+ skip_count);
+ else if (GMIME_IS_MULTIPART(mime_part)) {
+ if (*skip_count
+ || GMIME_IS_MULTIPART_SIGNED(mime_part)
|| GMIME_IS_MULTIPART_ENCRYPTED(mime_part)) {
/* Do not break crypto. */
if (parent)
@@ -1867,40 +1872,32 @@ lbm_mbox_prepare_object(GMimeObject * parent, GMimeObject * mime_part,
} else if (!parent)
g_mime_multipart_foreach((GMimeMultipart *) mime_part,
lbm_mbox_prepare_object, skip_count);
- } else if (GMIME_IS_MESSAGE_PART(mime_part))
- lbm_mbox_prepare_object(NULL,
- GMIME_OBJECT
- (((GMimeMessagePart *)
- mime_part)->message), skip_count);
- else if (GMIME_IS_MESSAGE(mime_part))
- lbm_mbox_prepare_object(NULL,
- ((GMimeMessage *) mime_part)->mime_part,
+ } else if (*skip_count)
+ -- * skip_count;
+ else if (GMIME_IS_MESSAGE_PART(mime_part))
+ lbm_mbox_prepare_object(NULL, GMIME_OBJECT(((GMimeMessagePart *)
+ mime_part)->message),
skip_count);
- else {
- if (*skip_count)
- --*skip_count;
- else if (!GMIME_IS_MESSAGE_PARTIAL(mime_part)) {
- GMimeContentEncoding encoding;
- GMimeContentType *mime_type;
-
- encoding =
- g_mime_part_get_content_encoding(GMIME_PART(mime_part));
- if (encoding == GMIME_CONTENT_ENCODING_BASE64)
- return;
+ else if (!GMIME_IS_MESSAGE_PARTIAL(mime_part)) {
+ GMimeContentEncoding encoding;
+ GMimeContentType *mime_type;
- mime_type = g_mime_object_get_content_type(mime_part);
- if (g_mime_content_type_is_type(mime_type, "text", "plain")) {
- const gchar *format =
- g_mime_content_type_get_parameter(mime_type, "format");
- if (format && !g_ascii_strcasecmp(format, "flowed"))
- /* Format=Flowed text cannot contain From_ lines. */
- return;
- }
+ encoding = g_mime_part_get_content_encoding(GMIME_PART(mime_part));
+ if (encoding == GMIME_CONTENT_ENCODING_BASE64)
+ return;
- g_mime_part_set_content_encoding
- (GMIME_PART(mime_part),
- GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE);
+ mime_type = g_mime_object_get_content_type(mime_part);
+ if (g_mime_content_type_is_type(mime_type, "text", "plain")) {
+ const gchar *format =
+ g_mime_content_type_get_parameter(mime_type, "format");
+ if (format && !g_ascii_strcasecmp(format, "flowed"))
+ /* Format=Flowed text cannot contain From_ lines. */
+ return;
}
+
+ g_mime_part_set_content_encoding
+ (GMIME_PART(mime_part),
+ GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]