diff options
author | Radek Doulik <rodo@ximian.com> | 2003-12-04 22:11:20 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2003-12-04 22:11:20 +0800 |
commit | 23017711eb711dc8e9296b4ed7a5a24d193fe6f2 (patch) | |
tree | f3a413d641c14de671637ef5e37b61034695eb4c | |
parent | 4c1234f54652f4db2ca5a8c01ea371f7ec061258 (diff) | |
download | gsoc2013-evolution-23017711eb711dc8e9296b4ed7a5a24d193fe6f2.tar.gz gsoc2013-evolution-23017711eb711dc8e9296b4ed7a5a24d193fe6f2.tar.zst gsoc2013-evolution-23017711eb711dc8e9296b4ed7a5a24d193fe6f2.zip |
check recent messages for junk mail
2003-12-04 Radek Doulik <rodo@ximian.com>
* camel-folder.c (folder_changed): check recent messages for junk
mail
* camel-session.c (camel_session_check_junk): new wrapper method
for check_junk flag
(camel_session_set_check_junk): ditto
* camel-session.h (struct _CamelSession): added check_junk flag
(if to check incoming mail for junk messages)
svn path=/trunk/; revision=23629
-rw-r--r-- | camel/ChangeLog | 12 | ||||
-rw-r--r-- | camel/camel-folder.c | 6 | ||||
-rw-r--r-- | camel/camel-session.c | 29 | ||||
-rw-r--r-- | camel/camel-session.h | 4 | ||||
-rw-r--r-- | camel/camel-store.c | 1 |
5 files changed, 49 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 4f01e895bd..ed23215906 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,15 @@ +2003-12-04 Radek Doulik <rodo@ximian.com> + + * camel-folder.c (folder_changed): check recent messages for junk + mail + + * camel-session.c (camel_session_check_junk): new wrapper method + for check_junk flag + (camel_session_set_check_junk): ditto + + * camel-session.h (struct _CamelSession): added check_junk flag + (if to check incoming mail for junk messages) + 2003-12-03 Jeffrey Stedfast <fejj@ximian.com> * camel-store.c (add_special_info): Free fi->path if we are gonna diff --git a/camel/camel-folder.c b/camel/camel-folder.c index f02b982d15..08fd816d97 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -41,6 +41,7 @@ #include "camel-filter-driver.h" #include "camel-private.h" #include "camel-vtrash-folder.h" +#include "filter/filter-rule.h" #define d(x) #define w(x) @@ -1647,9 +1648,10 @@ folder_changed (CamelObject *obj, gpointer event_data) CamelSession *session = ((CamelService *)folder->parent_store)->session; CamelFilterDriver *driver = NULL; - if ((folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) + if (((folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) || camel_session_check_junk (session)) && changed->uid_recent->len > 0) - driver = camel_session_get_filter_driver(session, "incoming", NULL); + driver = camel_session_get_filter_driver(session, + (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) ? FILTER_SOURCE_INCOMING : FILTER_SOURCE_JUNKTEST, NULL); CAMEL_FOLDER_LOCK(folder, change_lock); diff --git a/camel/camel-session.c b/camel/camel-session.c index 07c6801824..fc31530768 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -870,3 +870,32 @@ void camel_session_thread_wait(CamelSession *session, int id) CS_CLASS (session)->thread_wait(session, id); } + +/** + * camel_session_check_junk: + * @session: + * + * Do we have to check incoming messages to be junk? + **/ +gboolean +camel_session_check_junk (CamelSession *session) +{ + g_assert(CAMEL_IS_SESSION(session)); + + return session->check_junk; +} + +/** + * camel_session_set_check_junk: + * @session: + * @check_junk: + * + * Set check_junk flag, if set, incoming mail will be checked for being junk. + **/ +void +camel_session_set_check_junk (CamelSession *session, gboolean check_junk) +{ + g_assert(CAMEL_IS_SESSION(session)); + + session->check_junk = check_junk; +} diff --git a/camel/camel-session.h b/camel/camel-session.h index 43abc614a8..e99d31a334 100644 --- a/camel/camel-session.h +++ b/camel/camel-session.h @@ -62,6 +62,7 @@ struct _CamelSession gboolean online; CamelJunkPlugin *junk_plugin; + gboolean check_junk; }; #ifdef ENABLE_THREADS @@ -179,6 +180,9 @@ CamelFilterDriver *camel_session_get_filter_driver (CamelSession *session, const char *type, CamelException *ex); +gboolean camel_session_check_junk (CamelSession *session); +void camel_session_set_check_junk (CamelSession *session, gboolean check_junk); + #ifdef ENABLE_THREADS struct _CamelSessionThreadOps { void (*receive)(CamelSession *session, struct _CamelSessionThreadMsg *m); diff --git a/camel/camel-store.c b/camel/camel-store.c index 37b3007908..8d576d4583 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -694,7 +694,6 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co const char *url_base, gboolean unread_count) { CamelFolderInfo *fi, *vinfo, *parent; - CamelProvider *provider; char *uri, *path; CamelURL *url; |