0.8.11claws48
[claws.git] / src / procmime.c
index 5b2d5692df01c21b90a8a38d5d11c87a6e03ca3f..24dd3a12894002b17286fc6fd4e3850835776595 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -482,12 +482,10 @@ void procmime_scan_content_description(MimeInfo *mimeinfo,
        blen = strlen(buf) + 1;
        Xalloca(tmp, blen, return);
        conv_unmime_header(tmp, blen, buf, NULL);
-       g_free(mimeinfo->name);
-       mimeinfo->name = NULL;
        /*pgp signatures should NOT have a name */
        if (mimeinfo->content_type 
        &&  strcasecmp(mimeinfo->content_type, "application/pgp-signature"))
-               mimeinfo->name = g_strdup(tmp);
+               mimeinfo->description = g_strdup(tmp);
 }
 
 void procmime_scan_subject(MimeInfo *mimeinfo,
@@ -569,14 +567,6 @@ MimeInfo *procmime_scan_mime_header(FILE *fp)
                }
        }
 
-       if (mimeinfo->mime_type == MIME_APPLICATION_OCTET_STREAM &&
-           mimeinfo->name) {
-               const gchar *type;
-               type = procmime_get_mime_type(mimeinfo->name);
-               if (type)
-                       mimeinfo->mime_type = procmime_scan_mime_type(type);
-       }
-
        if (!mimeinfo->content_type)
                        mimeinfo->content_type = g_strdup("text/plain");
 
@@ -793,7 +783,7 @@ void renderer_write_config(void)
                        renderer->renderer);
        }
 
-       if (prefs_write_close(pfile) < 0) {
+       if (prefs_file_close(pfile) < 0) {
                g_warning("failed to write configuration to file\n");
                return;
        }
@@ -1238,10 +1228,14 @@ EncodingType procmime_get_encoding_for_charset(const gchar *charset)
        else if (!strncasecmp(charset, "ISO-2022-", 9) ||
                 !strcasecmp(charset, "US-ASCII"))
                return ENC_7BIT;
+       else if (!strcasecmp(charset, "ISO-8859-5") ||
+                !strncasecmp(charset, "KOI8-", 5) ||
+                !strcasecmp(charset, "Windows-1251"))
+               return ENC_8BIT;
+       else if (!strncasecmp(charset, "ISO-8859-", 9))
+               return ENC_QUOTED_PRINTABLE;
        else
                return ENC_8BIT;
-               /* return ENC_BASE64; */
-               /* return ENC_QUOTED_PRINTABLE; */
 }
 
 EncodingType procmime_get_encoding_for_file(const gchar *file)