diff options
author | Radek Doulik <rodo@ximian.com> | 2004-03-18 03:47:52 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2004-03-18 03:47:52 +0800 |
commit | 344bb7b1bcd540e761e9a4e9589e910069403369 (patch) | |
tree | c8a354fa3e45d5d51473ad53396d4ef2bf37b06b /camel/camel-folder.c | |
parent | 0d0740a85cdc7c15e1941e902499c043c4b0802f (diff) | |
download | gsoc2013-evolution-344bb7b1bcd540e761e9a4e9589e910069403369.tar.gz 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
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r-- | camel/camel-folder.c | 59 |
1 files changed, 27 insertions, 32 deletions
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) { |