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
This commit is contained in:
Jeffrey Stedfast
2000-12-01 00:39:11 +00:00
committed by Jeffrey Stedfast
parent c1d2ec0123
commit b715bf7b83
2 changed files with 12 additions and 32 deletions

View File

@ -1,3 +1,12 @@
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

View File

@ -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);