From: Jose Dapena Paz Date: Tue, 16 Jun 2009 11:25:47 +0000 (+0200) Subject: On forward, don't attach attachments of forwarded message 2 times. X-Git-Tag: 3.0.17-rc16~14 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=0b89af7ad6d3143f55dddb1407d5f05fbbe4116f On forward, don't attach attachments of forwarded message 2 times. --- diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index 4934028..b56ef3a 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -659,6 +659,7 @@ create_reply_forward_mail (TnyMsg *msg, TnyHeader *header, const gchar *from, gchar *subject_prefix; gboolean no_text_part; gchar *parent_uid; + gboolean forward_as_attach = FALSE; if (header) g_object_ref (header); @@ -688,8 +689,10 @@ create_reply_forward_mail (TnyMsg *msg, TnyHeader *header, const gchar *from, attachments); else { if (no_text_part || (html_body && (strcmp (tny_mime_part_get_content_type (html_body), "text/html")==0))) { + forward_as_attach = TRUE; new_msg = modest_formatter_attach (formatter, msg, header); } else { + forward_as_attach = FALSE; new_msg = modest_formatter_inline (formatter, body, header, attachments); } @@ -737,7 +740,7 @@ create_reply_forward_mail (TnyMsg *msg, TnyHeader *header, const gchar *from, g_object_unref (G_OBJECT (header)); /* ugly to unref it here instead of in the calling func */ - if (!is_reply & !no_text_part) { + if (!is_reply & !forward_as_attach) { add_attachments (TNY_MIME_PART (new_msg), attachments, FALSE, NULL); }