* cache the modest-conf keynames, so we don't have to re-calculate
[modest] / src / modest-tny-msg.c
index 4595afa..36cfc47 100644 (file)
@@ -267,9 +267,11 @@ add_attachments (TnyMsg *msg, GList *attachments_list)
        for (pos = (GList *)attachments_list; pos; pos = pos->next) {
 
                old_attachment = pos->data;
-               attachment_part = copy_mime_part (old_attachment);
-               tny_mime_part_add_part (TNY_MIME_PART (msg), attachment_part);
-               g_object_unref (attachment_part);
+               if (!tny_mime_part_is_purged (old_attachment)) {
+                       attachment_part = copy_mime_part (old_attachment);
+                       tny_mime_part_add_part (TNY_MIME_PART (msg), attachment_part);
+                       g_object_unref (attachment_part);
+               }
        }
 }
 
@@ -431,11 +433,11 @@ create_reply_forward_mail (TnyMsg *msg, TnyHeader *header, const gchar *from,
 
 
        /* if we don't have a text-part */
-       no_text_part = (strcmp (tny_mime_part_get_content_type (body), "text/html")==0);
+       no_text_part = (!body) || (strcmp (tny_mime_part_get_content_type (body), "text/html")==0);
        
        /* when we're reply, include the text part if we have it, or nothing otherwise. */
        if (is_reply)
-               new_msg = modest_formatter_inline  (formatter, no_text_part ? NULL: body, header,
+               new_msg = modest_formatter_quote  (formatter, no_text_part ? NULL: body, header,
                                                    attachments);
        else {
                /* for attachements; inline if there is a text part, and include the