From f561a84cdea45210b991faeddf908d7529d1592b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 1 Jan 2001 23:05:35 +0000 Subject: Use e_utf8_strstrcase() instead of just strstr(). (header_starts_with): 2000-12-21 Jeffrey Stedfast * filter-message-search.c (header_contains): Use e_utf8_strstrcase() instead of just strstr(). (header_starts_with): Make sure that the header contents are longer than the starts-with string. * vfoldertypes.xml: Don't send \"Subject\" to body-contains. Also added matches, starts-with, and ends-with xml stuff. svn path=/trunk/; revision=7204 --- filter/ChangeLog | 10 ++++ filter/filter-message-search.c | 9 ++-- filter/vfoldertypes.xml | 119 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 132 insertions(+), 6 deletions(-) (limited to 'filter') diff --git a/filter/ChangeLog b/filter/ChangeLog index 2b5c4ab9a3..671960400c 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,13 @@ +2000-12-21 Jeffrey Stedfast + + * filter-message-search.c (header_contains): Use + e_utf8_strstrcase() instead of just strstr(). + (header_starts_with): Make sure that the header contents are + longer than the starts-with string. + + * vfoldertypes.xml: Don't send \"Subject\" to body-contains. + Also added matches, starts-with, and ends-with xml stuff. + 2000-12-28 Dan Winship * filter-message-search.c (handle_multipart, body_contains, diff --git a/filter/filter-message-search.c b/filter/filter-message-search.c index cdfe64f2ae..4aee0dfdbd 100644 --- a/filter/filter-message-search.c +++ b/filter/filter-message-search.c @@ -21,6 +21,7 @@ */ #include "filter-message-search.h" +#include #include #include #include @@ -96,7 +97,7 @@ header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterM contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); if (contents) { - if (strstr (contents, match)) + if (e_utf8_strstrcase (contents, match)) matched = TRUE; } } @@ -167,7 +168,7 @@ header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filt contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - if (contents) { + if (contents && strlen (contents) >= strlen (match)) { /* danw says to use search-engine style matching... * This means that if the search match string is * lowercase then compare case-insensitive else @@ -695,7 +696,7 @@ user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageS } static ESExpResult * -get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) +get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) { ESExpResult *r; @@ -706,7 +707,7 @@ get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess } static ESExpResult * -get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) +get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) { ESExpResult *r; diff --git a/filter/vfoldertypes.xml b/filter/vfoldertypes.xml index 84d06964c4..36157e6ffc 100644 --- a/filter/vfoldertypes.xml +++ b/filter/vfoldertypes.xml @@ -12,9 +12,42 @@ does not contain (match-all (not (header-contains "From" ${sender}))) + + + + + + + Recipients @@ -33,9 +66,55 @@ (header-contains "Cc" ${recipient})))) + + + + + + + Subject @@ -51,6 +130,42 @@ (match-all (not (header-contains "Subject" ${subject}))) + + + + + + @@ -66,7 +181,7 @@ @@ -136,7 +251,7 @@ (match-all (not (< (get-received-date) ${versus}))) - + -- cgit v1.2.3