sync with sylpheed 0.6.2cvs10
authorPaul Mangan <paul@claws-mail.org>
Wed, 3 Oct 2001 05:23:24 +0000 (05:23 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 3 Oct 2001 05:23:24 +0000 (05:23 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/procmime.c
src/summaryview.c

index 61807ac..cea3d35 100644 (file)
--- 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
index da4ee07..399283e 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-03 [paul]      0.6.2claws16
+
+       * sync with sylpheed 0.6.2cvs10
+
 2001-10-02 [alfons]
 
        * configure.in
index c3ce6a6..9c75432 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-03
+
+       * src/procmime.c: procmime_get_text_content(): HTML ¤ËÂбþ¡£
+
 2001-10-02
 
        * src/summaryview.[ch]: ¿·¤¿¤Ê¥í¥Ã¥¯µ¡¹½¤ò¼ÂÁõ¤·¡¢Á´¤Æ¤ÎÀÅŪ¤Ê
index 2b0d77c..236f3e3 100644 (file)
@@ -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
index f12ef1e..3f69882 100644 (file)
@@ -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);
index 01c44a0..25fd4ac 100644 (file)
@@ -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) {