From 0eb8afc1d0cfa27d020a4191f44e400c714d190c Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Fri, 13 Apr 2001 22:08:03 +0000 Subject: Make the (previously unused) get-source command actually do the right 2001-04-13 Jon Trowbridge * camel-filter-search.c (get_source): Make the (previously unused) get-source command actually do the right thing, properly shrouding any passed-in source and falling back to use the source attached to the mime message. 2001-04-13 Jon Trowbridge * filtertypes.xml: Add XML specs for source account filtering. * filter-element.c (filter_element_new_type_name): Recognize type "source", construct a FilterSource. * filter-source.c: Added. A FilterElement for the account e-mail comes from. svn path=/trunk/; revision=9304 --- camel/ChangeLog | 7 +++++++ camel/camel-filter-search.c | 17 ++++++++++++++--- camel/camel-internet-address.c | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 7b2d2fa8d3..8e8d303b82 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-04-13 Jon Trowbridge + + * camel-filter-search.c (get_source): Make the (previously unused) + get-source command actually do the right thing, properly shrouding + any passed-in source and falling back to use the source attached + to the mime message. + 2001-04-13 Dan Winship * camel-object.c (camel_object_hook_event): diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c index 15e8eb77f2..78f4ee7b4c 100644 --- a/camel/camel-filter-search.c +++ b/camel/camel-filter-search.c @@ -35,6 +35,7 @@ #include #include "e-util/e-sexp.h" +#include "e-util/e-url.h" #include "camel-mime-message.h" #include "camel-filter-search.h" @@ -397,13 +398,20 @@ get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessag ESExpResult *r; r = e_sexp_result_new(f, ESEXP_RES_STRING); - r->value.string = g_strdup (fms->source); + if (fms->source) { + r->value.string = e_url_shroud (fms->source); + } else { + r->value.string = camel_mime_message_get_source (fms->message); + } + + g_message ("got source: [%s]", r->value.string); return r; } -gboolean camel_filter_search_match(CamelMimeMessage *message, CamelMessageInfo *info, - const char *source, const char *expression, CamelException *ex) +gboolean +camel_filter_search_match(CamelMimeMessage *message, CamelMessageInfo *info, + const char *source, const char *expression, CamelException *ex) { FilterMessageSearch fms; ESExp *sexp; @@ -452,3 +460,6 @@ error: e_sexp_unref(sexp); return FALSE; } + + + diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c index 416451b27d..902178c303 100644 --- a/camel/camel-internet-address.c +++ b/camel/camel-internet-address.c @@ -24,7 +24,7 @@ #include "camel-mime-utils.h" #include "camel-internet-address.h" -#define d(x) +#define d(x) static int internet_decode (CamelAddress *, const char *raw); static char * internet_encode (CamelAddress *); -- cgit v1.2.3