- /* Format message body */
- if (is_reply) {
- switch (type) {
- case MODEST_TNY_MSG_REPLY_TYPE_CITE:
- default:
- new_msg = modest_formatter_cite (formatter, body, header);
- break;
- case MODEST_TNY_MSG_REPLY_TYPE_QUOTE:
- new_msg = modest_formatter_quote (formatter, body, header, attachments);
- break;
- }
- } else {
- switch (type) {
- case MODEST_TNY_MSG_FORWARD_TYPE_INLINE:
- default:
- if (strcmp (tny_mime_part_get_content_type (body), "text/html")==0)
- new_msg = modest_formatter_attach (formatter, msg, header);
- else
- new_msg = modest_formatter_inline (formatter, body, header, attachments);
- break;
- case MODEST_TNY_MSG_FORWARD_TYPE_ATTACHMENT:
+
+ /* if we don't have a text-part */
+ no_text_part = (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,
+ attachments);
+ else {
+ /* for attachements; inline if there is a text part, and include the
+ * full old mail if there was none */
+ if (no_text_part)