aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-12-01 08:39:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-12-01 08:39:11 +0800
commitb715bf7b833335b8df6ce0f3783d15eec09106b1 (patch)
treebe9a4792d3ec2edcb9b677aa6c7819d5d6e44253
parentc1d2ec0123694a3b52e9c58de97c60994f5db587 (diff)
downloadgsoc2013-evolution-b715bf7b833335b8df6ce0f3783d15eec09106b1.tar.gz
gsoc2013-evolution-b715bf7b833335b8df6ce0f3783d15eec09106b1.tar.zst
gsoc2013-evolution-b715bf7b833335b8df6ce0f3783d15eec09106b1.zip
Use camel_message_info_free() instead of freeing everything by hand - is
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. svn path=/trunk/; revision=6750
-rw-r--r--filter/ChangeLog9
-rw-r--r--filter/filter-driver.c35
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);