0.9.10claws9
authorChristoph Hohmann <reboot@gmx.ch>
Fri, 12 Mar 2004 23:00:48 +0000 (23:00 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Fri, 12 Mar 2004 23:00:48 +0000 (23:00 +0000)
* src/codeconv.c
        add parameter check to conv_unmime_header_overwrite()

* src/imap.c
        o fix spelling
        o fix removing of NEW flag when UNREAD is unset

* src/procmime.c
        decode MIME-headers

(Closes 437 i18n attachment display error.)

ChangeLog.claws
configure.ac
src/codeconv.c
src/imap.c
src/procmime.c

index 7d64ed2..f92699c 100644 (file)
@@ -1,3 +1,17 @@
+2004-03-12 [christoph] 0.9.10claws9
+
+       * src/codeconv.c
+               add parameter check to conv_unmime_header_overwrite()
+
+       * src/imap.c
+               o fix spelling
+               o fix removing of NEW flag when UNREAD is unset
+
+       * src/procmime.c
+               decode MIME-headers
+
+       (Closes 437 i18n attachment display error.)
+
 2004-03-12 [paul]      0.9.10claws8
 
        * po/it.po
index 645630d..18fc49a 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=8
+EXTRA_VERSION=9
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 75a2e3e..5b922d4 100644 (file)
@@ -1456,6 +1456,8 @@ void conv_unmime_header_overwrite(gchar *str)
        gint buflen;
        CharSet cur_charset;
 
+       g_return_if_fail(str != NULL);
+       
        cur_charset = conv_get_current_charset();
 
        if (cur_charset == C_EUC_JP) {
index ec76325..f2633c5 100644 (file)
@@ -1719,7 +1719,7 @@ static gint imap_rename_folder(Folder *folder, FolderItem *item,
 
        if (strchr(name, imap_get_path_separator(IMAP_FOLDER(folder), item->path)) != NULL) {
                g_warning(_("New folder name must not contain the namespace "
-                           "path seperator"));
+                           "path separator"));
                return -1;
        }
 
@@ -4103,9 +4103,10 @@ static gint imap_get_flags(Folder *folder, FolderItem *item,
        GSList *sorted_list;
        /*
        GSList *new = NULL, *p_new;
+       GSList *deleted = NULL, *p_deleted;
        */
-       GSList *unseen = NULL, *answered = NULL, *flagged = NULL, *deleted = NULL;
-       GSList *p_unseen, *p_answered, *p_flagged, *p_deleted;
+       GSList *unseen = NULL, *answered = NULL, *flagged = NULL;
+       GSList *p_unseen, *p_answered, *p_flagged;
        GSList *elem;
        GSList *seq_list, *cur;
        gboolean reverse_seen = FALSE;
@@ -4169,24 +4170,27 @@ static gint imap_get_flags(Folder *folder, FolderItem *item,
        p_unseen = unseen;
        p_answered = answered;
        p_flagged = flagged;
+/*
        p_deleted = deleted;
-       
+*/     
        for (elem = sorted_list; elem != NULL; elem = g_slist_next(elem)) {
                MsgInfo *msginfo;
                MsgPermFlags flags;
+               gboolean wasnew;
                
                msginfo = (MsgInfo *) elem->data;
                flags = msginfo->flags.perm_flags;
-               flags &= ~((reverse_seen ? 0 : MSG_UNREAD) | MSG_REPLIED | MSG_MARKED);
+               wasnew = (flags & MSG_NEW);
+               flags &= ~((reverse_seen ? 0 : MSG_UNREAD | MSG_NEW) | MSG_REPLIED | MSG_MARKED);
                if (reverse_seen)
-                       flags |= MSG_UNREAD;
+                       flags |= MSG_UNREAD | (wasnew ? MSG_NEW : 0);
                /*
                if (gslist_find_next_num(&p_new, msginfo->msgnum) == msginfo->msgnum)
                        flags |= MSG_NEW;
                */
                if (gslist_find_next_num(&p_unseen, msginfo->msgnum) == msginfo->msgnum) {
                        if (!reverse_seen) {
-                               flags |= MSG_UNREAD;
+                               flags |= MSG_UNREAD | (wasnew ? MSG_NEW : 0);
                        } else {
                                flags &= ~(MSG_UNREAD | MSG_NEW);
                        }
@@ -4203,7 +4207,7 @@ static gint imap_get_flags(Folder *folder, FolderItem *item,
        }
 
        imap_seq_set_free(seq_list);
-       g_slist_free(deleted);
+       /* g_slist_free(deleted); */
        g_slist_free(flagged);
        g_slist_free(answered);
        g_slist_free(unseen);
index 41aaf79..c4b5cf9 100644 (file)
@@ -995,6 +995,12 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo)
        fp = fopen(mimeinfo->filename, "rb");
        fseek(fp, mimeinfo->offset, SEEK_SET);
        procheader_get_header_fields(fp, hentry);
+       if (hentry[0].body != NULL)
+               conv_unmime_header_overwrite(hentry[0].body);
+       if (hentry[2].body != NULL)
+               conv_unmime_header_overwrite(hentry[2].body);
+       if (hentry[4].body != NULL)
+               conv_unmime_header_overwrite(hentry[4].body);
        content_start = ftell(fp);
        fclose(fp);
 
@@ -1079,6 +1085,12 @@ void procmime_parse_multipart(MimeInfo *mimeinfo)
                                hentry[i].body = NULL;
                        }
                        procheader_get_header_fields(fp, hentry);
+                       if (hentry[0].body != NULL)
+                               conv_unmime_header_overwrite(hentry[0].body);
+                       if (hentry[2].body != NULL)
+                               conv_unmime_header_overwrite(hentry[2].body);
+                       if (hentry[4].body != NULL)
+                               conv_unmime_header_overwrite(hentry[4].body);
                        lastoffset = ftell(fp);
                }
        }