diff options
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/mail-ops.c | 204 |
2 files changed, 4 insertions, 204 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 8295067ce3..fa40885c39 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,7 @@ +2000-10-19 Dan Winship <danw@helixcode.com> + + * mail-ops.c: Clean up some old #if 0 code. + 2000-10-19 Jeffrey Stedfast <fejj@helixcode.com> * mail-format.c (mail_generate_reply): Get the MailConfigIdentity diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 11dff55b9a..44660ce797 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -98,134 +98,6 @@ mail_load_evolution_rule_context () return fc; } -#if 0 -/* to be removed */ -static void -mail_incorporate_messages (CamelFolder *folder, - fetch_mail_input_t *input, - fetch_mail_data_t *data, - CamelException *ex) -{ - CamelUIDCache *cache = NULL; - FilterContext *fc; - FilterDriver *filter; - GPtrArray *uids, *new_uids; - char *url, *p, *filename; - FILE *logfile; - int i; - time_t last_update = 0; - - fc = mail_load_evolution_rule_context (); - filter = filter_driver_new (fc, mail_tool_filter_get_folder_func, 0); - - if (input->hook_func) - camel_object_hook_event ( - CAMEL_OBJECT (input->destination), "folder_changed", - input->hook_func, input->hook_data); - - camel_folder_freeze (input->destination); - - uids = camel_folder_get_uids (folder); - - if (input->keep_on_server) { - /* get the mail source's uid cache file */ - url = camel_url_to_string (CAMEL_SERVICE (folder->parent_store)->url, FALSE); - for (p = url; *p; p++) { - if (!isascii ((unsigned char)*p) || strchr (" /'\"`&();|<>${}!", *p)) - *p = '_'; - } - - filename = g_strdup_printf ("%s/config/cache-%s", evolution_dir, url); - g_free (url); - - cache = camel_uid_cache_new (filename); - g_free (filename); - - if (cache) { - /* determine the new uids */ - new_uids = camel_uid_cache_get_new_uids (cache, uids); - camel_folder_free_uids (folder, uids); - uids = new_uids; - } - } - - /* FIXME: find out if we want to log or not - config option */ - if (TRUE /* perform_logging */) { - filename = g_strdup_printf ("%s/evolution-filter-log", evolution_dir); - logfile = fopen (filename, "a+"); - g_free (filename); - } else - logfile = NULL; - - /* get/filter the new messages */ - for (i = 0; i < uids->len; i++) { - CamelMimeMessage *message; - const CamelMessageInfo *info; - gboolean free_info; - gboolean last_message = (i+1 == uids->len); - time_t now; - - /* - * Update the time display ever 2 seconds - */ - time (&now); - if (last_message || ((now - last_update) > 2)){ - mail_op_set_message (_("Retrieving message %d of %d"), i + 1, uids->len); - last_update = now; - } - - 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 = camel_folder_get_message_info (folder, uids->pdata[i]); - else - info = NULL; - - filter_driver_filter_message(filter, message, info, input->destination, - FILTER_SOURCE_INCOMING, logfile, ex); - - /* 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 - the default (assuming we didn't get an exception) */ - if (!input->keep_on_server && !camel_exception_is_set (ex)) { - camel_folder_set_message_flags (folder, uids->pdata[i], - CAMEL_MESSAGE_DELETED, - CAMEL_MESSAGE_DELETED); - } - camel_object_unref (CAMEL_OBJECT (message)); - } - - /* close the log file */ - if (logfile) - fclose (logfile); - - gtk_object_unref (GTK_OBJECT (filter)); - - camel_folder_sync (folder, TRUE, ex); - - camel_folder_thaw (input->destination); - - if (input->hook_func) - camel_object_unhook_event ( - CAMEL_OBJECT (input->destination), "folder_changed", - input->hook_func, input->hook_data); - - if (cache) { - /* save the cache for the next time we fetch mail! */ - camel_uid_cache_free_uids (uids); - - if (!camel_exception_is_set (ex)) - camel_uid_cache_save (cache); - camel_uid_cache_destroy (cache); - } else - camel_folder_free_uids (folder, uids); - - data->empty = FALSE; -} -#endif - static void mail_op_report_status(FilterDriver *driver, enum filter_status_t status, const char *desc, CamelMimeMessage *msg, void *data) { @@ -493,82 +365,6 @@ do_filter_ondemand (gpointer in_data, gpointer op_data, CamelException *ex) mail_tool_camel_lock_down (); } -#if 0 -/* to be removed, old version */ -{ - { - - - - /* FIXME: find out if we want to log or not - config option */ - if (TRUE /* perform_logging */) { - filename = g_strdup_printf ("%s/evolution-filter-log", evolution_dir); - logfile = fopen (filename, "a+"); - g_free (filename); - } else - logfile = NULL; - - 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); - 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; - } - - /* check if this message is marked for deletion */ - if (info->flags & CAMEL_MESSAGE_DELETED) { - /* don't filter messages which have been marked as deleted */ - camel_object_unref (CAMEL_OBJECT (message)); - continue; - } - - filtered = filter_driver_run (driver, message, info, NULL, - FILTER_SOURCE_DEMAND, logfile, ex); - - 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; - - flags = camel_folder_get_message_flags (input->source, uids->pdata[i]); - camel_folder_set_message_flags (input->source, uids->pdata[i], - CAMEL_MESSAGE_DELETED, - ~flags); - } - - camel_object_unref (CAMEL_OBJECT (message)); - } - - /* close the log file */ - if (logfile) - fclose (logfile); - - gtk_object_unref (GTK_OBJECT (driver)); - - /* FIXME: when we hide deleted msgs, we may want to not expunge? */ - camel_folder_sync (input->source, /*TRUE*/ FALSE, ex); - - camel_folder_thaw (input->source); - - camel_folder_free_uids (input->source, uids); - } - mail_tool_camel_lock_down (); -} -#endif - static void cleanup_filter_ondemand (gpointer in_data, gpointer op_data, CamelException *ex) { |