sync with 0.7.4cvs29
authorPaul Mangan <paul@claws-mail.org>
Wed, 3 Apr 2002 14:02:06 +0000 (14:02 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 3 Apr 2002 14:02:06 +0000 (14:02 +0000)
src/imap.c

index 123e131bdb28e3a62f20bf5871e4ef67c708fee4..0f2e6fc0b2d89c7abf41df9776679332a8e90a46 100644 (file)
@@ -940,7 +940,7 @@ void imap_scan_folder(Folder *folder, FolderItem *item)
        statusbar_pop_all();
        if (ok != IMAP_SUCCESS) return;
 
-       item->new = recent;
+       item->new = unseen > 0 ? recent : 0;
        item->unread = unseen;
        item->total = messages;
        /* item->mtime = uid_validity; */
@@ -1781,6 +1781,7 @@ static gchar *imap_parse_atom(SockInfo *sock, gchar *src,
                                return cur_pos;
                        line_len += strlen(nextline);
                        g_string_append(str, nextline);
+                       cur_pos = str->str;
                        strretchomp(nextline);
                        log_print("IMAP4< %s\n", nextline);
                        g_free(nextline);
@@ -1890,8 +1891,8 @@ static MsgFlags imap_parse_flags(const gchar *flag_str)
        while ((p = strchr(p, '\\')) != NULL) {
                p++;
 
-               if (g_strncasecmp(p, "Recent", 6) == 0) {
-                       MSG_SET_PERM_FLAGS(flags, MSG_NEW|MSG_UNREAD);
+               if (g_strncasecmp(p, "Recent", 6) == 0 && MSG_IS_UNREAD(flags)) {
+                       MSG_SET_PERM_FLAGS(flags, MSG_NEW);
                } else if (g_strncasecmp(p, "Seen", 4) == 0) {
                        MSG_UNSET_PERM_FLAGS(flags, MSG_NEW|MSG_UNREAD);
                } else if (g_strncasecmp(p, "Deleted", 7) == 0) {