aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2004-03-18 03:47:52 +0800
committerRadek Doulik <rodo@src.gnome.org>2004-03-18 03:47:52 +0800
commit344bb7b1bcd540e761e9a4e9589e910069403369 (patch)
treec8a354fa3e45d5d51473ad53396d4ef2bf37b06b
parent0d0740a85cdc7c15e1941e902499c043c4b0802f (diff)
downloadgsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar
gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar.gz
gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar.bz2
gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar.lz
gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar.xz
gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar.zst
gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.zip
reverted last fix and:
2004-03-17 Radek Doulik <rodo@ximian.com> * camel-folder-summary.h: use 1<<30 for CAMEL_MESSAGE_JUNK_LEARN, 1<<17 was already used by imap provider and maybe others svn path=/trunk/; revision=25103
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-folder-summary.h6
-rw-r--r--camel/camel-folder.c59
3 files changed, 35 insertions, 36 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 1241ffc3fe..49df310c27 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,7 +1,7 @@
-2004-03-17 Jeffrey Stedfast <fejj@ximian.com>
+2004-03-17 Radek Doulik <rodo@ximian.com>
- * camel-folder.c (folder_changed): Don't bloody junktest filter
- mail unless the user has configured Evolution to do so.
+ * camel-folder-summary.h: use 1<<30 for CAMEL_MESSAGE_JUNK_LEARN,
+ 1<<17 was already used by imap provider and maybe others
2004-03-17 Not Zed <NotZed@Ximian.com>
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index d7ed505a1a..fc995874af 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -70,7 +70,11 @@ enum _CamelMessageFlags {
/* following flags are for the folder, and are not really permanent flags */
CAMEL_MESSAGE_FOLDER_FLAGGED = 1<<16, /* for use by the folder implementation */
- CAMEL_MESSAGE_JUNK_LEARN = 1<<17, /* used when setting CAMEL_MESSAGE_JUNK flag
+
+ /* flags after 1<<16 are used by camel providers,
+ if adding non permanent flags, add them to the end */
+
+ CAMEL_MESSAGE_JUNK_LEARN = 1<<30, /* used when setting CAMEL_MESSAGE_JUNK flag
to say that we request junk plugin
to learn that message as junk/non junk */
CAMEL_MESSAGE_USER = 1<<31 /* supports user flags */
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 909a5e429c..620881b1fc 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -1714,42 +1714,37 @@ folder_changed (CamelObject *obj, gpointer event_data)
camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
return ret;
}
-
- if ((folder->folder_flags & (CAMEL_FOLDER_FILTER_RECENT|CAMEL_FOLDER_FILTER_JUNK)) && changed->uid_recent->len > 0) {
- const char *source;
-
- if (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT)
- source = FILTER_SOURCE_INCOMING;
- else
- source = FILTER_SOURCE_JUNKTEST;
-
- if (folder->folder_flags & CAMEL_FOLDER_FILTER_JUNK) {
- guint32 flags;
- int i;
-
- for (i = 0; i < changed->uid_changed->len; i++) {
- flags = camel_folder_get_message_flags (folder, changed->uid_changed->pdata[i]);
- if (flags & CAMEL_MESSAGE_JUNK_LEARN) {
- if (flags & CAMEL_MESSAGE_JUNK) {
- if (!junk)
- junk = g_ptr_array_new ();
- g_ptr_array_add (junk, g_strdup (changed->uid_changed->pdata[i]));
- } else {
- if (!notjunk)
- notjunk = g_ptr_array_new ();
- g_ptr_array_add (notjunk, g_strdup (changed->uid_changed->pdata[i]));
- }
-
- /* reset junk learn flag so that we don't process it again */
- camel_folder_set_message_flags (folder, changed->uid_changed->pdata[i],
- CAMEL_MESSAGE_JUNK_LEARN, 0);
+
+ if (changed->uid_changed->len) {
+ int i;
+ guint32 flags;
+
+ for (i = 0; i < changed->uid_changed->len; i ++) {
+ flags = camel_folder_get_message_flags (folder, changed->uid_changed->pdata [i]);
+ if (flags & CAMEL_MESSAGE_JUNK_LEARN) {
+ if (flags & CAMEL_MESSAGE_JUNK) {
+ if (!junk)
+ junk = g_ptr_array_new();
+ g_ptr_array_add (junk, g_strdup (changed->uid_changed->pdata [i]));
+ } else {
+ if (!notjunk)
+ notjunk = g_ptr_array_new();
+ g_ptr_array_add (notjunk, g_strdup (changed->uid_changed->pdata [i]));
}
+ /* reset junk learn flag so that we don't process it again */
+ camel_folder_set_message_flags (folder, changed->uid_changed->pdata [i], CAMEL_MESSAGE_JUNK_LEARN, 0);
}
}
-
- driver = camel_session_get_filter_driver (session, source, NULL);
+ d(if (junk || notjunk) printf("** Have '%d' messages for junk filter to learn, launching thread to process them\n",
+ (junk ? junk->len : 0) + (notjunk ? notjunk->len : 0)));
}
-
+
+ if ((folder->folder_flags & (CAMEL_FOLDER_FILTER_RECENT|CAMEL_FOLDER_FILTER_JUNK))
+ && 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);
+
CAMEL_FOLDER_LOCK(folder, change_lock);
if (driver) {