From 22a9d810427da7139cf53532d460bde0ba534ac5 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 28 Sep 2001 23:31:42 +0000 Subject: Same here. 2001-09-28 Jeffrey Stedfast * camel-filter-search.c (get_source): Same here. * camel-mime-message.c (camel_mime_message_set_source): Don't use the e_url_shroud hack, use CamelURL functions instead. svn path=/trunk/; revision=13240 --- camel/ChangeLog | 7 +++++++ camel/camel-filter-search.c | 17 ++++++++++++----- camel/camel-mime-message.c | 24 +++++++++++++++--------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 2d2a2c71ad..6f437277bd 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-09-28 Jeffrey Stedfast + + * camel-filter-search.c (get_source): Same here. + + * camel-mime-message.c (camel_mime_message_set_source): Don't use + the e_url_shroud hack, use CamelURL functions instead. + 2001-09-28 Jeffrey Stedfast * providers/nntp/camel-nntp-provider.c diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c index c9c3d2853e..49ece8704a 100644 --- a/camel/camel-filter-search.c +++ b/camel/camel-filter-search.c @@ -35,7 +35,6 @@ #include #include "e-util/e-sexp.h" -#include "e-util/e-url.h" #include "camel-mime-message.h" #include "camel-filter-search.h" @@ -44,6 +43,8 @@ #include "camel-stream-mem.h" #include "camel-search-private.h" +#include "camel-url.h" + #define d(x) typedef struct { @@ -411,16 +412,22 @@ static ESExpResult * get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) { ESExpResult *r; - char *src; + char *src = NULL; char *tmp; r = e_sexp_result_new (f, ESEXP_RES_STRING); if (fms->source) { - src = e_url_shroud (fms->source); + CamelURL *url; + + url = camel_url_new (fms->source, NULL); + if (url) { + src = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); + camel_url_free (url); + } } else { src = g_strdup (camel_mime_message_get_source (fms->message)); } - + /* This is an abusive hack */ if ( src && (tmp = strstr (src, "://")) ) { tmp += 3; @@ -428,7 +435,7 @@ get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessag if (tmp) *tmp = '\0'; } - + r->value.string = src; return r; diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c index 3ffa25f84e..53edc4f53b 100644 --- a/camel/camel-mime-message.c +++ b/camel/camel-mime-message.c @@ -32,13 +32,12 @@ #include #include -#include "e-util/e-url.h" - #include "camel-mime-message.h" #include "camel-multipart.h" #include "camel-stream-mem.h" #include "string-utils.h" #include "hash-table-utils.h" +#include "camel-url.h" #include "camel-stream-filter.h" #include "camel-stream-null.h" @@ -408,12 +407,18 @@ camel_mime_message_set_recipients(CamelMimeMessage *mime_message, const char *ty void camel_mime_message_set_source (CamelMimeMessage *mime_message, const char *src) { - char *shrouded_src; + CamelURL *url; + char *uri; + g_assert (mime_message); - shrouded_src = e_url_shroud (src); - camel_medium_add_header (CAMEL_MEDIUM (mime_message), "X-Evolution-Source", shrouded_src); - g_free (shrouded_src); + url = camel_url_new (src, NULL); + if (url) { + uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); + camel_medium_add_header (CAMEL_MEDIUM (mime_message), "X-Evolution-Source", uri); + g_free (uri); + camel_url_free (url); + } } const char * @@ -843,16 +848,17 @@ struct _check_content_id { }; static gboolean -check_content_id (CamelMimeMessage *message, CamelMimePart *part, struct _check_content_id *data) +check_content_id (CamelMimeMessage *message, CamelMimePart *part, void *data) { + struct _check_content_id *check = (struct _check_content_id *) data; const char *content_id; gboolean found; content_id = camel_mime_part_get_content_id (part); - found = content_id && !strcmp (content_id, data->content_id) ? TRUE : FALSE; + found = content_id && !strcmp (content_id, check->content_id) ? TRUE : FALSE; if (found) { - data->part = part; + check->part = part; camel_object_ref (CAMEL_OBJECT (part)); } -- cgit v1.2.3