diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-09-14 05:51:03 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-09-14 05:51:03 +0000 |
commit | 000486a77e6a305e1466ed23169f4e96e36c00f6 (patch) | |
tree | 46d4c4bf432efc2277e434a72ae9e466ec7c6814 | |
parent | a94ab16492fbcd9c4b568a237bd21df8aed78763 (diff) |
update summary cache when importing from mbox.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2248 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | libsylph/mbox.c | 31 |
2 files changed, 28 insertions, 7 deletions
@@ -1,5 +1,9 @@ 2009-09-14 + * libsylph/mbox.c: update summary cache when importing from mbox. + +2009-09-14 + * libsylph/mh.c libsylph/procmsg.[ch] libsylph/folder.[ch] diff --git a/libsylph/mbox.c b/libsylph/mbox.c index 7ecae25c..d63278c5 100644 --- a/libsylph/mbox.c +++ b/libsylph/mbox.c @@ -35,6 +35,7 @@ #include "mbox.h" #include "procmsg.h" +#include "procheader.h" #include "folder.h" #include "filter.h" #include "prefs_common.h" @@ -118,6 +119,7 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox, gboolean is_next_msg = FALSE; gboolean is_junk = FALSE; FilterInfo *fltinfo; + MsgInfo *msginfo; count++; if (folder->ui_func) @@ -222,30 +224,44 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox, fltinfo->flags.perm_flags = MSG_NEW|MSG_UNREAD; fltinfo->flags.tmp_flags = MSG_RECEIVED; + msginfo = procheader_parse_file(tmp_file, fltinfo->flags, + FALSE); + if (!msginfo) { + g_warning("proc_mbox_full: procheader_parse_file failed"); + filter_info_free(fltinfo); + g_unlink(tmp_file); + g_free(tmp_file); + fclose(mbox_fp); + return -1; + } + msginfo->file_path = g_strdup(tmp_file); + if (filter_junk && prefs_common.enable_junk && prefs_common.filter_junk_before) { - filter_apply(prefs_common.junk_fltlist, tmp_file, - fltinfo); + filter_apply_msginfo(prefs_common.junk_fltlist, msginfo, + fltinfo); if (fltinfo->drop_done) is_junk = TRUE; } if (!fltinfo->drop_done && apply_filter) - filter_apply(prefs_common.fltlist, tmp_file, fltinfo); + filter_apply_msginfo(prefs_common.fltlist, msginfo, + fltinfo); if (!fltinfo->drop_done && filter_junk && prefs_common.enable_junk && !prefs_common.filter_junk_before) { - filter_apply(prefs_common.junk_fltlist, tmp_file, - fltinfo); + filter_apply_msginfo(prefs_common.junk_fltlist, msginfo, + fltinfo); if (fltinfo->drop_done) is_junk = TRUE; } if (fltinfo->actions[FLT_ACTION_MOVE] == FALSE && fltinfo->actions[FLT_ACTION_DELETE] == FALSE) { - if (folder_item_add_msg(dest, tmp_file, &fltinfo->flags, - FALSE) < 0) { + msginfo->flags = fltinfo->flags; + if (folder_item_add_msg_msginfo(dest, msginfo, FALSE) < 0) { + procmsg_msginfo_free(msginfo); filter_info_free(fltinfo); g_unlink(tmp_file); g_free(tmp_file); @@ -279,6 +295,7 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox, fltinfo->actions[FLT_ACTION_MARK_READ] == FALSE) new_msgs++; + procmsg_msginfo_free(msginfo); filter_info_free(fltinfo); g_unlink(tmp_file); } while (from_line[0] != '\0'); |