From b836707290a360630c93cfcd4fe38cf420e59649 Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Wed, 3 Oct 2001 05:23:24 +0000 Subject: [PATCH] sync with sylpheed 0.6.2cvs10 --- ChangeLog | 4 ++++ ChangeLog.claws | 4 ++++ ChangeLog.jp | 4 ++++ configure.in | 2 +- src/procmime.c | 35 +++++++++++++++++++++++++++-------- src/summaryview.c | 1 + 6 files changed, 41 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61807aca5..cea3d353d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-10-03 + + * src/procmime.c: procmime_get_text_content(): supported HTML. + 2001-10-02 * src/summaryview.[ch]: implemented new locking mechanism, and diff --git a/ChangeLog.claws b/ChangeLog.claws index da4ee079a..399283e95 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,7 @@ +2001-10-03 [paul] 0.6.2claws16 + + * sync with sylpheed 0.6.2cvs10 + 2001-10-02 [alfons] * configure.in diff --git a/ChangeLog.jp b/ChangeLog.jp index c3ce6a69c..9c754326d 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,7 @@ +2001-10-03 + + * src/procmime.c: procmime_get_text_content(): HTML ¤ËÂбþ¡£ + 2001-10-02 * src/summaryview.[ch]: ¿·¤¿¤Ê¥í¥Ã¥¯µ¡¹½¤ò¼ÂÁõ¤·¡¢Á´¤Æ¤ÎÀÅŪ¤Ê diff --git a/configure.in b/configure.in index 2b0d77c8f..236f3e32d 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=6 MICRO_VERSION=2 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws15 +EXTRA_VERSION=claws16 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl diff --git a/src/procmime.c b/src/procmime.c index f12ef1e43..3f698829e 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -35,6 +35,7 @@ #include "base64.h" #include "uuencode.h" #include "unmime.h" +#include "html.h" #include "codeconv.h" #include "utils.h" #include "prefs_common.h" @@ -642,6 +643,7 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo, FILE *infp) gchar *src_codeset; gboolean conv_fail = FALSE; gchar buf[BUFFSIZE]; + gchar *str; g_return_val_if_fail(mimeinfo != NULL, NULL); g_return_val_if_fail(infp != NULL, NULL); @@ -669,18 +671,30 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo, FILE *infp) src_codeset = prefs_common.force_charset ? prefs_common.force_charset : mimeinfo->charset; - while (fgets(buf, sizeof(buf), tmpfp) != NULL) { - gchar *str; + if (mimeinfo->mime_type == MIME_TEXT) { + while (fgets(buf, sizeof(buf), tmpfp) != NULL) { + str = conv_codeset_strdup(buf, src_codeset, NULL); + if (str) { + fputs(str, outfp); + g_free(str); + } else { + conv_fail = TRUE; + fputs(buf, outfp); + } + } + } else if (mimeinfo->mime_type == MIME_TEXT_HTML) { + HTMLParser *parser; + CodeConverter *conv; - str = conv_codeset_strdup(buf, src_codeset, NULL); - if (str) { + conv = conv_code_converter_new(src_codeset); + parser = html_parser_new(tmpfp, conv); + while ((str = html_parse(parser)) != NULL) { fputs(str, outfp); - g_free(str); - } else { - conv_fail = TRUE; - fputs(buf, outfp); } + html_parser_destroy(parser); + conv_code_converter_destroy(conv); } + if (conv_fail) g_warning(_("procmime_get_text_content(): Code conversion failed.\n")); @@ -710,6 +724,11 @@ FILE *procmime_get_first_text_content(MsgInfo *msginfo) partinfo = mimeinfo; while (partinfo && partinfo->mime_type != MIME_TEXT) partinfo = procmime_mimeinfo_next(partinfo); + if (!partinfo) { + partinfo = mimeinfo; + while (partinfo && partinfo->mime_type != MIME_TEXT_HTML) + partinfo = procmime_mimeinfo_next(partinfo); + } if (partinfo) outfp = procmime_get_text_content(partinfo, infp); diff --git a/src/summaryview.c b/src/summaryview.c index 01c44a032..25fd4acd3 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -3799,6 +3799,7 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event, GtkCTreeNode *node; FolderItem *to_folder; + if (summary_is_locked(summaryview)) return; if (!event) return; switch (event->keyval) { -- 2.25.1