From 57d3cf597bc3161b682906beac134d80f6f9b8d7 Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 6 Feb 2007 07:59:36 +0000 Subject: filter junk mails from local mbox even if prefs_common.filter_on_inc is FALSE. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1531 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 7 +++++++ ChangeLog.ja | 7 +++++++ configure.in | 2 +- libsylph/mbox.c | 15 +++++++++++---- libsylph/mbox.h | 7 ++++++- src/inc.c | 23 ++++++++++------------- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index fdb45a17..4d98249c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-06 + + * libsylph/mbox.[ch] + src/inc.c: filter junk mails from local mbox even if + prefs_common.filter_on_inc is FALSE. + proc_mbox_full(): added. + 2007-02-06 * src/prefs_toolbar.[ch] diff --git a/ChangeLog.ja b/ChangeLog.ja index 7c2abc42..3d59f95e 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,10 @@ +2007-02-06 + + * libsylph/mbox.[ch] + src/inc.c: prefs_common.filter_on_inc が FALSE であってもローカル + スプールから迷惑メールをフィルタするようにした。 + proc_mbox_full(): 追加。 + 2007-02-06 * src/prefs_toolbar.[ch] diff --git a/configure.in b/configure.in index 15e39b07..8abebb7f 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ MINOR_VERSION=4 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=beta2 +EXTRA_VERSION=beta3 BUILD_REVISION=0 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION diff --git a/libsylph/mbox.c b/libsylph/mbox.c index 7385c285..10e94297 100644 --- a/libsylph/mbox.c +++ b/libsylph/mbox.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2006 Hiroyuki Yamamoto + * Copyright (C) 1999-2007 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -57,6 +57,13 @@ } gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table) +{ + return proc_mbox_full(dest, mbox, folder_table, + folder_table ? TRUE : FALSE); +} + +gint proc_mbox_full(FolderItem *dest, const gchar *mbox, + GHashTable *folder_table, gboolean apply_filter) { FILE *mbox_fp; gchar buf[MSGBUFSIZE], from_line[MSGBUFSIZE]; @@ -204,18 +211,18 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table) fltinfo->flags.perm_flags = MSG_NEW|MSG_UNREAD; fltinfo->flags.tmp_flags = MSG_RECEIVED; - if (folder_table && prefs_common.enable_junk && + if (prefs_common.enable_junk && prefs_common.filter_junk_on_recv && prefs_common.filter_junk_before) { filter_apply(prefs_common.junk_fltlist, tmp_file, fltinfo); } - if (!fltinfo->drop_done && folder_table) + if (!fltinfo->drop_done && apply_filter) filter_apply(prefs_common.fltlist, tmp_file, fltinfo); if (!fltinfo->drop_done && - folder_table && prefs_common.enable_junk && + prefs_common.enable_junk && prefs_common.filter_junk_on_recv && !prefs_common.filter_junk_before) { filter_apply(prefs_common.junk_fltlist, tmp_file, diff --git a/libsylph/mbox.h b/libsylph/mbox.h index ce0f9112..eb29ecac 100644 --- a/libsylph/mbox.h +++ b/libsylph/mbox.h @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2005 Hiroyuki Yamamoto + * Copyright (C) 1999-2007 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,11 @@ typedef enum { gint proc_mbox (FolderItem *dest, const gchar *mbox, GHashTable *folder_table); +gint proc_mbox_full (FolderItem *dest, + const gchar *mbox, + GHashTable *folder_table, + gboolean apply_filter); + gint lock_mbox (const gchar *base, LockType type); gint unlock_mbox (const gchar *base, diff --git a/src/inc.c b/src/inc.c index 9bed8960..0aeeb9b3 100644 --- a/src/inc.c +++ b/src/inc.c @@ -1400,26 +1400,23 @@ static gint get_spool(FolderItem *dest, const gchar *mbox) debug_print(_("Getting new messages from %s into %s...\n"), mbox, dest->path); - if (prefs_common.filter_on_inc) - folder_table = g_hash_table_new(NULL, NULL); - msgs = proc_mbox(dest, tmp_mbox, folder_table); + folder_table = g_hash_table_new(NULL, NULL); + + msgs = proc_mbox_full(dest, tmp_mbox, folder_table, + prefs_common.filter_on_inc); g_unlink(tmp_mbox); if (msgs >= 0) empty_mbox(mbox); unlock_mbox(mbox, lockfd, LOCK_FLOCK); - if (folder_table) { - if (!prefs_common.scan_all_after_inc) { - folder_item_scan_foreach(folder_table); - folderview_update_item_foreach - (folder_table, !prefs_common.open_inbox_on_inc); - } - g_hash_table_destroy(folder_table); - } else if (!prefs_common.scan_all_after_inc) { - folder_item_scan(dest); - folderview_update_item(dest, TRUE); + if (!prefs_common.scan_all_after_inc) { + folder_item_scan_foreach(folder_table); + folderview_update_item_foreach + (folder_table, !prefs_common.open_inbox_on_inc); } + g_hash_table_destroy(folder_table); + return msgs; } -- cgit v1.2.3