diff options
-rw-r--r-- | filter/ChangeLog | 9 | ||||
-rw-r--r-- | filter/filter-driver.c | 35 |
2 files changed, 12 insertions, 32 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 63071ff250..3429264415 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,14 @@ 2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> + * filter-driver.c (filter_driver_filter_message): Use + camel_message_info_free() instead of freeing everything by hand - + is this a new function? I don't ever recall seeing this + before. Also use my new function, + camel_message_info_new_from_header - ahhh... this code is now so + beatiful. Okay, I'm done. + +2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> + * filter-driver.c (filter_driver_filter_message): Update to use EStrv in appropriate places (wrapped with #ifdef DOESTRV for the moment). diff --git a/filter/filter-driver.c b/filter/filter-driver.c index 1b8038062a..bfb437bb38 100644 --- a/filter/filter-driver.c +++ b/filter/filter-driver.c @@ -738,27 +738,9 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C if (info == NULL) { struct _header_raw *h = CAMEL_MIME_PART (message)->headers; - char *subject, *from, *to, *cc; - info = g_new0 (CamelMessageInfo, 1); + info = camel_message_info_new_from_header (h); freeinfo = TRUE; - - /* FIXME: do we even *need* to set these? Are they even used? -- fejj */ - subject = camel_folder_summary_format_string (h, "subject"); - from = camel_folder_summary_format_address (h, "from"); - to = camel_folder_summary_format_address (h, "to"); - cc = camel_folder_summary_format_address (h, "cc"); -#ifdef DOESTRV - camel_message_info_set_subject (info, subject); - camel_message_info_set_from (info, from); - camel_message_info_set_to (info, to); - camel_message_info_set_cc (info, cc); -#else - info->subject = subject; - info->from = from; - info->to = to; - info->cc = cc; -#endif /* DOESTRV */ } else { if (info->flags & CAMEL_MESSAGE_DELETED) return; @@ -822,19 +804,8 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C if (p->deleted) info->flags = info->flags | CAMEL_MESSAGE_DELETED; - if (freeinfo) { - camel_flag_list_free (&info->user_flags); - camel_tag_list_free (&info->user_tags); -#ifdef DOESTRV - e_strv_destroy (info->strings); -#else - g_free (info->subject); - g_free (info->from); - g_free (info->to); - g_free (info->cc); -#endif /* DOESTRV */ - g_free (info); - } + if (freeinfo) + camel_message_info_free (info); if (filtered) filter_driver_log (driver, FILTER_LOG_END, NULL); |