summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-09-28 23:31:42 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2001-09-28 23:31:42 +0000
commit16a601aab1bca606a8e6a5e8992dd7945337349d (patch)
tree025456cbed8016d2754704f7fae8fdd964224ac4
parentac054aeb9adfde2f9c3f7f08cc396488cd467e2f (diff)
downloadevolution-data-server-16a601aab1bca606a8e6a5e8992dd7945337349d.tar.gz
Same here.
2001-09-28 Jeffrey Stedfast <fejj@ximian.com> * 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.
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-filter-search.c17
-rw-r--r--camel/camel-mime-message.c24
3 files changed, 34 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 2d2a2c71a..6f437277b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,12 @@
2001-09-28 Jeffrey Stedfast <fejj@ximian.com>
+ * 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 <fejj@ximian.com>
+
* providers/nntp/camel-nntp-provider.c
(camel_provider_module_init): Init the nntp url hash and url_equal
functions.
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index c9c3d2853..49ece8704 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -35,7 +35,6 @@
#include <ctype.h>
#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 3ffa25f84..53edc4f53 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -32,13 +32,12 @@
#include <stdio.h>
#include <string.h>
-#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));
}