diff options
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/camel-folder.c | 2 | ||||
-rw-r--r-- | camel/camel-session.c | 29 | ||||
-rw-r--r-- | camel/camel-session.h | 9 |
4 files changed, 43 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 40992db18e..61ac6dd235 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2004-01-23 Radek Doulik <rodo@ximian.com> + + * camel-folder.c (folder_changed): use check_junk_for_imap flag + + * camel-session.c: add check_junk_for_imap flag + 2004-01-23 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (IMAP_SMALL_BODY_SIZE): diff --git a/camel/camel-folder.c b/camel/camel-folder.c index 08fd816d97..c2ff8ef759 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -1648,7 +1648,7 @@ 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) || camel_session_check_junk (session)) + if (((folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) || (camel_session_check_junk (session) && camel_session_check_junk_for_imap (session))) && changed->uid_recent->len > 0) driver = camel_session_get_filter_driver(session, (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) ? FILTER_SOURCE_INCOMING : FILTER_SOURCE_JUNKTEST, NULL); diff --git a/camel/camel-session.c b/camel/camel-session.c index b7d86c571a..0e5efa1d9c 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -904,3 +904,32 @@ camel_session_set_check_junk (CamelSession *session, gboolean check_junk) session->check_junk = check_junk; } + +/** + * camel_session_check_junk_for_imap + * @session: + * + * Do we have to check IMAP incoming messages to be junk? + **/ +gboolean +camel_session_check_junk_for_imap (CamelSession *session) +{ + g_assert(CAMEL_IS_SESSION(session)); + + return session->check_junk_for_imap; +} + +/** + * camel_session_set_check_junk_for_imap: + * @session: + * @check_junk_for_imap: + * + * Set check_junk_for_imap flag, if set, incoming IMAP mail will be checked for being junk. + **/ +void +camel_session_set_check_junk_for_imap (CamelSession *session, gboolean check_junk_for_imap) +{ + g_assert(CAMEL_IS_SESSION(session)); + + session->check_junk_for_imap = check_junk_for_imap; +} diff --git a/camel/camel-session.h b/camel/camel-session.h index cd811a6304..27beb0a45f 100644 --- a/camel/camel-session.h +++ b/camel/camel-session.h @@ -69,6 +69,7 @@ struct _CamelSession CamelJunkPlugin *junk_plugin; gboolean check_junk; + gboolean check_junk_for_imap; }; #ifdef ENABLE_THREADS @@ -184,8 +185,12 @@ 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); +gboolean camel_session_check_junk (CamelSession *session); +void camel_session_set_check_junk (CamelSession *session, + gboolean check_junk); +gboolean camel_session_check_junk_for_imap (CamelSession *session); +void camel_session_set_check_junk_for_imap (CamelSession *session, + gboolean check_junk_for_imap); #ifdef ENABLE_THREADS struct _CamelSessionThreadOps { |