X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-tny-msg.c;h=8608447e32ab691fb6e763b3658b2265dc220e78;hb=98936b16511d3ca4b7e0c09908eed8392c7d869e;hp=f7879ba5b60c1f41d5c1444d46376f75cbb00fa6;hpb=206b438aa9012c7c4c70d76fb547ce3b3223de73;p=modest diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index f7879ba..8608447 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -85,7 +85,14 @@ modest_tny_msg_new (const gchar* mailto, const gchar* from, const gchar *cc, tny_header_set_subject (TNY_HEADER (header), subject); content_type = get_content_type(body); - + + /* set modest as the X-Mailer + * we could this in the platform factory, but then the header + * would show up before all the others. + */ + tny_mime_part_set_header_pair (TNY_MIME_PART (new_msg), "X-Mailer", "Modest " + VERSION); + /* Add the body of the new mail */ /* This is needed even if body is NULL or empty. */ add_body_part (new_msg, body, content_type); @@ -94,6 +101,8 @@ modest_tny_msg_new (const gchar* mailto, const gchar* from, const gchar *cc, /* Add attachments */ if (attachments) add_attachments (TNY_MIME_PART (new_msg), attachments, FALSE); + if (header) + g_object_unref(header); return new_msg; } @@ -127,7 +136,14 @@ modest_tny_msg_new_html_plain (const gchar* mailto, const gchar* from, const gch tny_header_set_subject (TNY_HEADER (header), subject); content_type = get_content_type(plain_body); - + + /* set modest as the X-Mailer + * we could this in the platform factory, but then the header + * would show up before all the others. + */ + tny_mime_part_set_header_pair (TNY_MIME_PART (new_msg), "X-Mailer", "Modest " + VERSION); + /* Add the body of the new mail */ add_body_part (new_msg, plain_body, content_type); add_html_body_part (new_msg, html_body); @@ -136,6 +152,8 @@ modest_tny_msg_new_html_plain (const gchar* mailto, const gchar* from, const gch /* Add attachments */ add_attachments (TNY_MIME_PART (new_msg), attachments, FALSE); add_images (new_msg, images); + if (header) + g_object_unref(header); return new_msg; } @@ -249,6 +267,7 @@ copy_mime_part (TnyMimePart *part) TnyMimePart *subpart_copy = copy_mime_part (subpart); tny_mime_part_add_part (result, subpart_copy); g_object_unref (subpart); + g_object_unref (subpart_copy); } tny_iterator_next (iterator); @@ -271,9 +290,9 @@ add_attachments (TnyMimePart *part, GList *attachments_list, gboolean add_inline old_attachment = pos->data; if (!tny_mime_part_is_purged (old_attachment)) { attachment_part = copy_mime_part (old_attachment); - tny_mime_part_add_part (TNY_MIME_PART (part), attachment_part); tny_mime_part_set_header_pair (attachment_part, "Content-Disposition", add_inline?"inline":"attachment"); + tny_mime_part_add_part (TNY_MIME_PART (part), attachment_part); g_object_unref (attachment_part); } } @@ -528,7 +547,14 @@ create_reply_forward_mail (TnyMsg *msg, TnyHeader *header, const gchar *from, g_object_set_data_full (G_OBJECT(new_msg), MODEST_TNY_MSG_PARENT_UID, parent_uid, g_free); } - + + /* set modest as the X-Mailer + * we could this in the platform factory, but then the header + * would show up before all the others. + */ + tny_mime_part_set_header_pair (TNY_MIME_PART (msg), "X-Mailer", "Modest " + VERSION); + /* Clean */ g_object_unref (G_OBJECT (new_header)); g_object_unref (G_OBJECT (header));