From 5dfe756f5f673429b6579600053e35047a2fa3cf Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 8 Aug 2001 09:37:40 +0000 Subject: Properly determine match type to pass to header_match. 2001-08-08 Not Zed * camel-filter-search.c (check_header): Properly determine match type to pass to header_match. (address_matches_exactly): Removed, effectively added to camel_search_header_match. * camel-folder-search.c (check_header): Properly determine the match type to pass to header_match. * camel-search-private.c (camel_search_header_match): Add a new parameter 'type' which is the type of header we're matching against. ASIS means utf8 format, ADDRESS means an internet address ('formatted'), ADDRESS_ENCODED means a raw address header, ENCODED means rfc 2047 encoded text. (header_match): Move original logic here, have search_header_match call it as appropriate for the 'type' of match. 2001-08-07 Not Zed * camel-session.c (camel_session_class_init): Only init the vee provider struct once (if we're subclassed this will get called multiple times). * camel-object.c (obj_finalize): Removed a bit of a debug that crept in with jacob's poolv patch (?). svn path=/trunk/; revision=11772 --- camel/camel-folder-search.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'camel/camel-folder-search.c') diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index 72a2dce139..34506ebfa9 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -537,6 +537,7 @@ check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolder const char *header = NULL; char strbuf[32]; int i; + camel_search_t type = CAMEL_SEARCH_TYPE_ASIS; /* only a subset of headers are supported .. */ headername = argv[0]->value.string; @@ -548,10 +549,13 @@ check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolder header = strbuf; } else if (!strcasecmp(headername, "from")) { header = camel_message_info_from(search->current); + type = CAMEL_SEARCH_TYPE_ADDRESS; } else if (!strcasecmp(headername, "to")) { header = camel_message_info_to(search->current); + type = CAMEL_SEARCH_TYPE_ADDRESS; } else if (!strcasecmp(headername, "cc")) { header = camel_message_info_cc(search->current); + type = CAMEL_SEARCH_TYPE_ADDRESS; } else if (!strcasecmp(headername, "x-camel-mlist")) { header = camel_message_info_mlist(search->current); } else { @@ -562,10 +566,8 @@ check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolder if (header) { /* performs an OR of all words */ for (i=1;itype == ESEXP_RES_STRING - && camel_search_header_match(header, argv[i]->value.string, how)) { - truth = TRUE; - } + if (argv[i]->type == ESEXP_RES_STRING) + truth = camel_search_header_match(header, argv[i]->value.string, how, type); } } } -- cgit v1.2.3