diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-09-08 12:00:27 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-09-08 12:00:27 +0800 |
commit | 38b00e41dd0b79f95aa48552567c1253d525bfaf (patch) | |
tree | b05740fb37f28e7e8d3333062891891bd87c88c5 /mail | |
parent | 26149933266aea9e787e07d4cc312d6b06dc0d65 (diff) | |
download | gsoc2013-evolution-38b00e41dd0b79f95aa48552567c1253d525bfaf.tar.gz gsoc2013-evolution-38b00e41dd0b79f95aa48552567c1253d525bfaf.tar.zst gsoc2013-evolution-38b00e41dd0b79f95aa48552567c1253d525bfaf.zip |
Updated to pass a CamelMessageInfo to filter_driver_run
2000-09-08 Jeffrey Stedfast <fejj@helixcode.com>
* mail-ops.c (do_fetch_mail): Updated to pass a CamelMessageInfo
to filter_driver_run
(do_filter_ondemand): Same.
svn path=/trunk/; revision=5252
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/mail-ops.c | 40 |
2 files changed, 42 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 77c7505058..7b06fce78c 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,7 +1,13 @@ +2000-09-08 Jeffrey Stedfast <fejj@helixcode.com> + + * mail-ops.c (do_fetch_mail): Updated to pass a CamelMessageInfo + to filter_driver_run + (do_filter_ondemand): Same. + 2000-09-07 Jeffrey Stedfast <fejj@helixcode.com> * mail-ops.c (do_filter_ondemand): Updated to check the boolean - return code from fulter_driver_run to find out whether or not the + return code from filter_driver_run to find out whether or not the message was filtered so that it can decide whether or not to delete the message from the source folder or not. diff --git a/mail/mail-ops.c b/mail/mail-ops.c index de440f801d..5c3ab58eac 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -161,14 +161,28 @@ do_fetch_mail (gpointer in_data, gpointer op_data, CamelException *ex) uids = camel_folder_get_uids (folder); for (i = 0; i < uids->len; i++) { CamelMimeMessage *message; + CamelMessageInfo *info; + gboolean free_info; - mail_tool_camel_lock_up (); message = camel_folder_get_message (folder, uids->pdata[i], ex); + if (camel_exception_is_set (ex)) + continue; + + if (camel_folder_has_summary_capability (folder)) { + info = (CamelMessageInfo *) camel_folder_get_message_info (folder, uids->pdata[i]); + free_info = FALSE; + } else { + info = g_new0 (CamelMessageInfo, 1); + free_info = TRUE; + } + filter_driver_run (filter, message, input->destination, - FILTER_SOURCE_INCOMING, + info, FILTER_SOURCE_INCOMING, input->hook_func, input->hook_data, TRUE, ex); - mail_tool_camel_lock_down (); + + if (free_info) + camel_message_info_free (info); /* we don't care if it was filtered or not here because no matter what it's been copied to at least 1 folder - even if it's just @@ -325,13 +339,29 @@ do_filter_ondemand (gpointer in_data, gpointer op_data, CamelException *ex) uids = camel_folder_get_uids (input->source); for (i = 0; i < uids->len; i++) { CamelMimeMessage *message; + CamelMessageInfo *info; gboolean filtered; + gboolean free_info; message = camel_folder_get_message (input->source, uids->pdata[i], ex); - filtered = filter_driver_run (input->driver, message, NULL, + if (camel_exception_is_set (ex)) + continue; + + if (camel_folder_has_summary_capability (input->source)) { + info = (CamelMessageInfo *) camel_folder_get_message_info (input->source, uids->pdata[i]); + free_info = FALSE; + } else { + info = g_new0 (CamelMessageInfo, 1); + free_info = TRUE; + } + + filtered = filter_driver_run (input->driver, message, info, NULL, FILTER_SOURCE_DEMAND, NULL, NULL, TRUE, ex); - if (filtered) { + if (free_info) + camel_message_info_free (info); + + if (filtered && !camel_exception_is_set (ex)) { /* we can delete this since it's been filtered */ guint32 flags; |