[PATCH 4/7] In bs parser put proper part spec id to direct child of message/rfc822



---
 ChangeLog                                    |    2 ++
 libtinymail-camel/camel-lite/bs/bodystruct.c |   11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2c8e84e..49e89c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
 	in tny_camel_bs_mime_part_get_parts, as this is the expected
 	structure in tinymail.
 	* Handle better in IMAP "NIL" parameter in fetch response.
+	* Fix part specs of direct child of attached messages in
+	bodystruct parser.
 
 2009-12-11  Sergio Villar Senin  <svillar igalia com>
 
diff --git a/libtinymail-camel/camel-lite/bs/bodystruct.c b/libtinymail-camel/camel-lite/bs/bodystruct.c
index 870872b..a9859c8 100644
--- a/libtinymail-camel/camel-lite/bs/bodystruct.c
+++ b/libtinymail-camel/camel-lite/bs/bodystruct.c
@@ -661,10 +661,15 @@ bodystruct_part_decode (unsigned char **in, unsigned char *inend, bodystruct_t *
 	part->parent = parent;
 
 	if (parent) {
-		if (parent->part_spec)
-			part->part_spec = g_strdup_printf ("%s.%d", parent->part_spec, num);
-		else
+		if (parent->part_spec) {
+			if (!strcasecmp (parent->content.type, "message") && !strcasecmp (parent->content.subtype, "rfc822")) {
+				part->part_spec = g_strdup (parent->part_spec);
+			} else {
+				part->part_spec = g_strdup_printf ("%s.%d", parent->part_spec, num);
+			}
+		} else {
 			part->part_spec = g_strdup_printf ("%d", num);
+		}
 	}
 
 	if (*inptr == '(') {
-- 
1.6.3.3


--=-7xSGRSdHbBXdNvov60N6
Content-Disposition: attachment; filename*0=0005-Refactor-decode_it-and-decode_it_2-to-be-both-in-tny.pat; filename*1=ch
Content-Type: text/x-patch; name="0005-Refactor-decode_it-and-decode_it_2-to-be-both-in-tny.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]