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 61807aca5c3a5667b4707459106c9fd53458a018..cea3d353d28207539ca5f58370cfea8ad91ad065 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 da4ee079a3169c415ab3b9a3adee75669cededea..399283e9527bd97e34869c52cde406aae86ba518 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 c3ce6a69c8afa9969629692833cf22b1aee0dc9e..9c754326d227ba764cde4bd48b838d00e1b4c919 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-03
+
+       * src/procmime.c: procmime_get_text_content(): HTML ¤ËÂбþ¡£
+
 2001-10-02
 
        * src/summaryview.[ch]: ¿·¤¿¤Ê¥í¥Ã¥¯µ¡¹½¤ò¼ÂÁõ¤·¡¢Á´¤Æ¤ÎÀÅŪ¤Ê
index 2b0d77c8fa53b19a328ee6bf3933576ae814c49d..236f3e32d4b65b804a5177e94b71c878680fcb9e 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 f12ef1e43fb5eb1dd3923bbd19f0bb329a9cd2aa..3f698829e24db73ed87ad75fba1d92d44eb14f76 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 01c44a032d8586bf3c3dbfd5a343b497acd1d15c..25fd4acd3821e9b33ad62f6585aa3ded1feb2d28 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) {