revert erroneous 2b0b467727d110b8505517bd92261608e499f57f; we need
[claws.git] / src / textview.c
index 2d027c2..9131f91 100644 (file)
@@ -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);