From 3ee9de9029f44ea808975fd049805690f7613529 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Mon, 5 May 2014 17:24:09 +0200 Subject: [PATCH 1/1] revert erroneous 2b0b467727d110b8505517bd92261608e499f57f; we need this differenciation to show attachments --- src/textview.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/textview.c b/src/textview.c index 2d027c2fe..9131f91f2 100644 --- a/src/textview.c +++ b/src/textview.c @@ -636,7 +636,15 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp) textview_clear(textview); - textview_add_parts(textview, mimeinfo); + if (mimeinfo->type == MIMETYPE_MULTIPART || + (mimeinfo->type == MIMETYPE_MESSAGE && !g_ascii_strcasecmp(mimeinfo->subtype, "rfc822"))) { + textview_add_parts(textview, mimeinfo); + } else { + if (fseek(fp, mimeinfo->offset, SEEK_SET) < 0) + perror("fseek"); + + textview_write_body(textview, mimeinfo); + } textview->loading = FALSE; textview->stop_loading = FALSE; @@ -797,7 +805,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo) END_TIMING(); GTK_EVENTS_FLUSH(); } - } else { + } else if (mimeinfo->type == MIMETYPE_TEXT) { if (prefs_common.display_header && (charcount > 0)) gtk_text_buffer_insert(buffer, &iter, "\n", 1); -- 2.25.1