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 --- libsylph/mbox.c | 15 +++++++++++---- libsylph/mbox.h | 7 ++++++- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'libsylph') 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, -- cgit v1.2.3